"""find_vtable_xrefs.py Scan a PE for code/data references to a vtable VA. A constructor's vtable-store is the canonical 'who owns this vtable' xref. Pure stdlib — parses PE headers by hand.""" import struct, sys def parse_pe(path): with open(path, 'rb') as f: data = f.read() if data[:2] != b'MZ': raise ValueError("not PE") pe_off = struct.unpack_from('= 80: print(f" (stopping after 80 in {name})") break if __name__ == '__main__': main()