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 # Parse PE import table to find GetPrivateProfileStringA IAT entry # PE header e_lfanew = struct.unpack_from(' %s" % (iat_va, fn_str)) thunk_fo += 4 thunk_idx += 1 fo += 20