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 IAT = { 0x482370:'VirtualAlloc', 0x4823cc:'LocalAlloc', 0x48240c:'ExitProcess', 0x482390:'CreateFileA', 0x4822f4:'DirectDrawCreate', 0x4822fc:'DirectSoundCreate', 0x48248c:'MessageBoxA', 0x48243c:'GetVersion', 0x48242c:'GetStartupInfoA', } def show(start, length, label=''): if label: print("=== %s ===" % label) for row in range(start, start + length, 16): chunk = data[row:row+16] ann = [] for j in range(len(chunk)): f = row + j try: if data[f] == 0xe8 and f+5 <= len(data): rel = struct.unpack_from('