import struct, sys, io sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') data = open('HAVOC_NOCD.EXE','rb').read() FO2VA = lambda fo: fo + 0x400C00 VA2FO = lambda va: va - 0x400C00 # Show context around the "missing from the HAVOC directory" string fo = 0x6bec5 print("=== Context around FO 0x%05x ===" % fo) start = fo - 0x80 end = fo + 0x80 chunk = data[start:end] for i in range(0, len(chunk), 16): row = chunk[i:i+16] hex_part = ' '.join('%02x' % b for b in row) asc_part = ''.join(chr(b) if 32 <= b < 127 else '.' for b in row) print("FO 0x%05x: %-47s %s" % (start+i, hex_part, asc_part)) print() print("=== Callers of 'missing' string at FO 0x6BEC5 VA 0x46CAC5 ===") target = 0x46cac5 for fo2 in range(0x400, 0x67000): if data[fo2] == 0x68: # PUSH imm32 imm = struct.unpack_from('