import struct exe = open("HAVOC_NOCD.EXE", "rb").read() # Read PE header pe_off = struct.unpack_from('10} {'VirtSize':>10} {'RawOff':>10} {'RawSize':>10}") sections = [] for i in range(num_sections): s = sections_off + i * 40 name = exe[s:s+8].rstrip(b'\x00').decode('latin1', errors='replace') virt_rva = struct.unpack_from('