OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Makes sure that all EXE and DLL files in the provided directory were built | 6 """Makes sure that all EXE and DLL files in the provided directory were built |
7 correctly. | 7 correctly. |
8 | 8 |
9 In essense it runs a subset of BinScope tests ensuring that binaries have | 9 In essense it runs a subset of BinScope tests ensuring that binaries have |
10 /NXCOMPAT, /DYNAMICBASE and /SAFESEH. | 10 /NXCOMPAT, /DYNAMICBASE and /SAFESEH. |
(...skipping 12 matching lines...) Expand all Loading... |
23 DYNAMICBASE_FLAG = 0x0040 | 23 DYNAMICBASE_FLAG = 0x0040 |
24 NXCOMPAT_FLAG = 0x0100 | 24 NXCOMPAT_FLAG = 0x0100 |
25 NO_SEH_FLAG = 0x0400 | 25 NO_SEH_FLAG = 0x0400 |
26 MACHINE_TYPE_AMD64 = 0x8664 | 26 MACHINE_TYPE_AMD64 = 0x8664 |
27 | 27 |
28 # Please do not add your file here without confirming that it indeed doesn't | 28 # Please do not add your file here without confirming that it indeed doesn't |
29 # require /NXCOMPAT and /DYNAMICBASE. Contact cpu@chromium.org or your local | 29 # require /NXCOMPAT and /DYNAMICBASE. Contact cpu@chromium.org or your local |
30 # Windows guru for advice. | 30 # Windows guru for advice. |
31 EXCLUDED_FILES = ['chrome_frame_mini_installer.exe', | 31 EXCLUDED_FILES = ['chrome_frame_mini_installer.exe', |
32 'mini_installer.exe', | 32 'mini_installer.exe', |
33 'wow_helper.exe'] | 33 'wow_helper.exe', |
| 34 'xinput1_3.dll' # Microsoft DirectX redistributable. |
| 35 ] |
34 | 36 |
35 def IsPEFile(path): | 37 def IsPEFile(path): |
36 return (os.path.isfile(path) and | 38 return (os.path.isfile(path) and |
37 os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS and | 39 os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS and |
38 os.path.basename(path) not in EXCLUDED_FILES) | 40 os.path.basename(path) not in EXCLUDED_FILES) |
39 | 41 |
40 def main(options, args): | 42 def main(options, args): |
41 directory = args[0] | 43 directory = args[0] |
42 pe_total = 0 | 44 pe_total = 0 |
43 pe_passed = 0 | 45 pe_passed = 0 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if __name__ == '__main__': | 100 if __name__ == '__main__': |
99 usage = "Usage: %prog [options] DIRECTORY" | 101 usage = "Usage: %prog [options] DIRECTORY" |
100 option_parser = optparse.OptionParser(usage=usage) | 102 option_parser = optparse.OptionParser(usage=usage) |
101 option_parser.add_option("-v", "--verbose", action="store_true", | 103 option_parser.add_option("-v", "--verbose", action="store_true", |
102 default=False, help="Print debug logging") | 104 default=False, help="Print debug logging") |
103 options, args = option_parser.parse_args() | 105 options, args = option_parser.parse_args() |
104 if not args: | 106 if not args: |
105 option_parser.print_help() | 107 option_parser.print_help() |
106 sys.exit(0) | 108 sys.exit(0) |
107 main(options, args) | 109 main(options, args) |
OLD | NEW |