diff options
author | jschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-14 07:05:10 +0000 |
---|---|---|
committer | jschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-14 07:05:10 +0000 |
commit | 4c725561e0041c10c1f4e08e39bf057f745d25c6 (patch) | |
tree | 24049177b8cca13ef394f8024a920a6655ba597f | |
parent | 552622777ea645d7e3a6e10045eec193f292631c (diff) | |
download | chromium_src-4c725561e0041c10c1f4e08e39bf057f745d25c6.zip chromium_src-4c725561e0041c10c1f4e08e39bf057f745d25c6.tar.gz chromium_src-4c725561e0041c10c1f4e08e39bf057f745d25c6.tar.bz2 |
Make checkbins verify Win64 ImageBase is greater than 4GB
BUG=361670
R=wfh@chromium.org
TBR=wfh@chromium.org
Review URL: https://codereview.chromium.org/236683002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263596 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | tools/checkbins/checkbins.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/checkbins/checkbins.py b/tools/checkbins/checkbins.py index e166eec..213f30a 100755 --- a/tools/checkbins/checkbins.py +++ b/tools/checkbins/checkbins.py @@ -89,6 +89,17 @@ def main(options, args): success = False print "Checking %s for /SAFESEH... FAIL" % path + # ASLR is weakened on Windows 64-bit when the ImageBase is below 4GB + # (because the loader will never be rebase the image above 4GB). + if pe.FILE_HEADER.Machine == MACHINE_TYPE_AMD64: + if pe.OPTIONAL_HEADER.ImageBase <= 0xFFFFFFFF: + print("Checking %s ImageBase (0x%X < 4GB)... FAIL" % + (path, pe.OPTIONAL_HEADER.ImageBase)) + success = False + elif options.verbose: + print("Checking %s ImageBase (0x%X > 4GB)... PASS" % + (path, pe.OPTIONAL_HEADER.ImageBase)) + # Update tally. if success: pe_passed = pe_passed + 1 |