#!/usr/bin/env python3 """Read-only PE32 import/export/RTTI evidence inventory, no third-party modules. Addresses are preferred-base VAs, not relocation-adjusted runtime addresses. Usage: python3 tools/binary/pe_inspect.py ../Original/OMT2.dll --symbols 'render|timer' """ import argparse import hashlib import json from pathlib import Path import re import struct class PE: def __init__(self, path): self.path = Path(path) self.data = self.path.read_bytes() if self.data[:2] != b'MZ': raise ValueError('Missing MZ signature') nt = self.u32(0x3c) if self.data[nt:nt+4] != b'PE\0\0': raise ValueError('Missing PE signature') self.machine, count = struct.unpack_from('