diff --git a/tools/isledecomp/isledecomp/bin.py b/tools/isledecomp/isledecomp/bin.py index 255341f1..23ddda72 100644 --- a/tools/isledecomp/isledecomp/bin.py +++ b/tools/isledecomp/isledecomp/bin.py @@ -64,17 +64,12 @@ class Bin: """Parses a PE format EXE and allows reading data from a virtual address. Reference: ohttps://learn.microsoft.com/en-us/windows/win32/debug/pe-format""" - # pylint: disable=too-many-instance-attributes - # Could remove textvirt and textraw in an upcoming refactor - def __init__(self, filename, logger=None): self.logger = logger self._debuglog(f'Parsing headers of "{filename}"... ') self.filename = filename self.file = None self.imagebase = None - self.textvirt = None - self.textraw = None self.sections = [] self.last_section = None @@ -108,10 +103,6 @@ def __enter__(self): text_section = self._get_section_by_name(".text") self.last_section = text_section - # These are used by reccmp - self.textvirt = text_section.VirtualAddress - self.textraw = text_section.PointerToRawData - self._debuglog("... Parsing finished") return self diff --git a/tools/reccmp/reccmp.py b/tools/reccmp/reccmp.py index 02c16029..9bd5abf7 100755 --- a/tools/reccmp/reccmp.py +++ b/tools/reccmp/reccmp.py @@ -86,7 +86,7 @@ def filter_out_ptr(ptype, op_str): for i, word in enumerate(words): try: inttest = int(word, 16) - if inttest >= file.imagebase + file.textvirt: + if inttest >= file.get_section_offset_by_index(1): words[i] = placeholder_generator.get(inttest) except ValueError: pass