diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-03-05 13:52:20 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-03-05 13:52:20 +0000 |
commit | d149c21d54c46ff22fa1341c3966fd07e458a4d8 (patch) | |
tree | eee7a975f932333e8dd59278fa13ca5ccb7c86d6 /Tools | |
parent | Update copyright notice. (diff) | |
download | cpython-d149c21d54c46ff22fa1341c3966fd07e458a4d8.tar.gz cpython-d149c21d54c46ff22fa1341c3966fd07e458a4d8.tar.bz2 cpython-d149c21d54c46ff22fa1341c3966fd07e458a4d8.zip |
Open dll file in binary.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/msi/msilib.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/msi/msilib.py b/Tools/msi/msilib.py index 7ff8e9b78a2..d7b86ccb0dc 100644 --- a/Tools/msi/msilib.py +++ b/Tools/msi/msilib.py @@ -644,9 +644,9 @@ class Dialog: return self.control(name, "CheckBox", x, y, w, h, attr, prop, text, next, None) def pe_type(path): - header = open(path).read(1000) - # offset of PE header is at offset 0x3c; 1-based - pe_offset = struct.unpack("<i", header[0x3c:0x40])[0]-1 + header = open(path, "rb").read(1000) + # offset of PE header is at offset 0x3c + pe_offset = struct.unpack("<i", header[0x3c:0x40])[0] assert header[pe_offset:pe_offset+4] == "PE\0\0" machine = struct.unpack("<H", header[pe_offset+4:pe_offset+6])[0] return machine |