summaryrefslogtreecommitdiffstats
path: root/tools/symsrc/pdb_fingerprint_from_img.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/symsrc/pdb_fingerprint_from_img.py')
-rwxr-xr-x[-rw-r--r--]tools/symsrc/pdb_fingerprint_from_img.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/symsrc/pdb_fingerprint_from_img.py b/tools/symsrc/pdb_fingerprint_from_img.py
index c7dae50..e994475 100644..100755
--- 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())