| 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())
|
|
|