https://git.reactos.org/?p=reactos.git;a=commitdiff;h=599843ac8e29b2279042c1...
commit 599843ac8e29b2279042c1eda20e1b07b329bd37 Author: Timo Kreuzer timo.kreuzer@reactos.org AuthorDate: Mon Apr 29 17:00:18 2019 +0200 Commit: Timo Kreuzer timo.kreuzer@reactos.org CommitDate: Sat Jul 20 13:56:18 2019 +0200
[TOOLS] Make gen_baseaddress.py python 3 compatible --- sdk/tools/gen_baseaddress.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sdk/tools/gen_baseaddress.py b/sdk/tools/gen_baseaddress.py index 3a4c1e68d5c..673f67d5519 100644 --- a/sdk/tools/gen_baseaddress.py +++ b/sdk/tools/gen_baseaddress.py @@ -203,13 +203,13 @@ def is_x64():
def size_of_image_fallback(filename): with open(filename, 'rb') as fin: - if fin.read(2) != 'MZ': + if fin.read(2) != b'MZ': print(filename, 'No dos header found!') return 0 fin.seek(0x3C) e_lfanew = struct.unpack('i', fin.read(4))[0] fin.seek(e_lfanew) - if fin.read(4) != 'PE\0\0': + if fin.read(4) != b'PE\0\0': print(filename, 'No PE header found!') return 0 fin.seek(e_lfanew + 0x18) @@ -332,8 +332,8 @@ class MemoryLayout(object): def guess_version(ntdll_path): if 'pefile' in globals(): ntdll_pe = pefile.PE(ntdll_path, fast_load=True) - names = [sect.Name.strip('\0') for sect in ntdll_pe.sections] - count = '|'.join(names).count('/') + names = [sect.Name.strip(b'\0') for sect in ntdll_pe.sections] + count = b'|'.join(names).count(b'/') if '.rossym' in names: print('# This should probably go in baseaddress.cmake') elif is_x64():