import re, struct, os exe = open("HAVOC_NOCD.EXE", "rb").read() # ── 1. Verify raw bytes at known path locations ── print("=== Raw bytes at path string locations ===") spots = [ (0x06b27c, 16, "MUSIC.FF area"), (0x06b288, 16, "INTRFACE.FF area"), (0x06b2b0, 24, "WORLDS\\ area"), (0x06b390, 30, "C:\\WORLDS\\LAND0101 area"), (0x06b3a8, 20, "HAVOCDAT area"), (0x06b3b8, 16, "BIGFILE area"), (0x06b978, 24, "GAMIMAGE area"), ] for fo, length, label in spots: raw = exe[fo:fo+length] asc = ''.join(chr(b) if 0x20 <= b < 0x7f else '.' for b in raw) print(f" 0x{fo:06x} {label}: {raw.hex(' ')}") print(f" ascii: {asc!r}") # ── 2. Check which expected files exist ── print("\n=== File existence check in game dir ===") game_files = [ "BIGFILE.DAT", "MUSIC.FF", "INTRFACE.FF", "OBJECTS.FF", "SOUND.FF", "STRDATA.DAT", "HAVOC.INI", "GAMIMAGE.DAT", "KEYSET.DAT", "WORLDS/LAND0101.DAT", "WORLDS/GRAFIX00.DAT", ] for f in game_files: exists = os.path.exists(f) print(f" {'OK' if exists else 'MISSING':8s} {f}") # ── 3. Find SetCurrentDirectory / GetModuleFileName in imports ── print("\n=== SetCurrentDirectory / GetModuleFileName call sites ===") for api_bytes in [b'SetCurrentDirectoryA', b'GetModuleFileNameA', b'_chdir']: idx = exe.find(api_bytes) if idx == -1: print(f" NOT IN EXE: {api_bytes.decode()}") continue print(f" {api_bytes.decode()} name at 0x{idx:06x}") # find IAT VA for this hint_fo = idx - 2 int_rva = hint_fo - 0x000400 + 0x001000 iat_needle = struct.pack('