Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: tools/symsrc/pdb_fingerprint_from_img.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/symsrc/img_fingerprint.py ('k') | tools/symsrc/source_index.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/symsrc/pdb_fingerprint_from_img.py
diff --git a/tools/symsrc/pdb_fingerprint_from_img.py b/tools/symsrc/pdb_fingerprint_from_img.py
old mode 100644
new mode 100755
index c7dae5033a2867a66ec4ae315307dcf5a4a8cf8a..e99447541a75f635d17e91ef3b1f9a7029fe4095
--- a/tools/symsrc/pdb_fingerprint_from_img.py
+++ b/tools/symsrc/pdb_fingerprint_from_img.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
-
-# Copyright (c) 2008 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -16,12 +15,14 @@ DLL's reference to the PDB, and use that to retrieve the information."""
import sys
import pefile
+
__CV_INFO_PDB70_format__ = ('CV_INFO_PDB70',
('4s,CvSignature', '16s,Signature', 'L,Age'))
__GUID_format__ = ('GUID',
('L,Data1', 'H,Data2', 'H,Data3', '8s,Data4'))
+
def GetPDBInfoFromImg(filename):
"""Returns the PDB fingerprint and the pdb filename given an image file"""
@@ -48,10 +49,16 @@ def GetPDBInfoFromImg(filename):
break
-if __name__ == '__main__':
+
+def main():
if len(sys.argv) != 2:
print "usage: file.dll"
- sys.exit(1)
+ return 1
+
+ (fingerprint, filename) = GetPDBInfoFromImg(sys.argv[1])
+ print "%s %s" % (fingerprint, filename)
+ return 0
- (fingerprint, file) = GetPDBInfoFromImg(sys.argv[1])
- print "%s %s" % (fingerprint, file)
+
+if __name__ == '__main__':
+ sys.exit(main())
« no previous file with comments | « tools/symsrc/img_fingerprint.py ('k') | tools/symsrc/source_index.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698