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 13 matching lines...) Expand all Loading... |
24 DYNAMICBASE_FLAG = 0x0040 | 24 DYNAMICBASE_FLAG = 0x0040 |
25 NXCOMPAT_FLAG = 0x0100 | 25 NXCOMPAT_FLAG = 0x0100 |
26 NO_SEH_FLAG = 0x0400 | 26 NO_SEH_FLAG = 0x0400 |
27 MACHINE_TYPE_AMD64 = 0x8664 | 27 MACHINE_TYPE_AMD64 = 0x8664 |
28 | 28 |
29 # Please do not add your file here without confirming that it indeed doesn't | 29 # Please do not add your file here without confirming that it indeed doesn't |
30 # require /NXCOMPAT and /DYNAMICBASE. Contact cpu@chromium.org or your local | 30 # require /NXCOMPAT and /DYNAMICBASE. Contact cpu@chromium.org or your local |
31 # Windows guru for advice. | 31 # Windows guru for advice. |
32 EXCLUDED_FILES = ['chrome_frame_mini_installer.exe', | 32 EXCLUDED_FILES = ['chrome_frame_mini_installer.exe', |
33 'mini_installer.exe', | 33 'mini_installer.exe', |
| 34 'next_version_mini_installer.exe', |
34 'wow_helper.exe' | 35 'wow_helper.exe' |
35 ] | 36 ] |
36 | 37 |
37 def IsPEFile(path): | 38 def IsPEFile(path): |
38 return (os.path.isfile(path) and | 39 return (os.path.isfile(path) and |
39 os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS and | 40 os.path.splitext(path)[1].lower() in PE_FILE_EXTENSIONS and |
40 os.path.basename(path) not in EXCLUDED_FILES) | 41 os.path.basename(path) not in EXCLUDED_FILES) |
41 | 42 |
42 def main(options, args): | 43 def main(options, args): |
43 directory = args[0] | 44 directory = args[0] |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 usage = "Usage: %prog [options] DIRECTORY" | 122 usage = "Usage: %prog [options] DIRECTORY" |
122 option_parser = optparse.OptionParser(usage=usage) | 123 option_parser = optparse.OptionParser(usage=usage) |
123 option_parser.add_option("-v", "--verbose", action="store_true", | 124 option_parser.add_option("-v", "--verbose", action="store_true", |
124 default=False, help="Print debug logging") | 125 default=False, help="Print debug logging") |
125 option_parser.add_option("--json", help="Path to JSON output file") | 126 option_parser.add_option("--json", help="Path to JSON output file") |
126 options, args = option_parser.parse_args() | 127 options, args = option_parser.parse_args() |
127 if not args: | 128 if not args: |
128 option_parser.print_help() | 129 option_parser.print_help() |
129 sys.exit(0) | 130 sys.exit(0) |
130 main(options, args) | 131 main(options, args) |
OLD | NEW |