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

Side by Side Diff: tools/symsrc/img_fingerprint.py

Issue 155136: Add the symbol and source server scripts. (Closed)
Patch Set: review feedback Created 11 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « tools/symsrc/COPYING-pefile ('k') | tools/symsrc/pdb_fingerprint_from_img.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 # Copyright (c) 2008 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """This will retrieve an image's "fingerprint". This is used when retrieving
8 the image from the symbol server. The .dll (or cab compressed .dl_) or .exe
9 is expected at a path like:
10 foo.dll/FINGERPRINT/foo.dll"""
11
12 import sys
13 import pefile
14
15 def GetImgFingerprint(filename):
16 """Returns the fingerprint for an image file"""
17
18 pe = pefile.PE(filename)
19 return "%08X%06x" % (
20 pe.FILE_HEADER.TimeDateStamp, pe.OPTIONAL_HEADER.SizeOfImage)
21
22
23 if __name__ == '__main__':
24 if len(sys.argv) != 2:
25 print "usage: file.dll"
26 sys.exit(1)
27
28 print GetImgFingerprint(sys.argv[1])
OLDNEW
« no previous file with comments | « tools/symsrc/COPYING-pefile ('k') | tools/symsrc/pdb_fingerprint_from_img.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698