# SPDX-License-Identifier: GPL-3.0-or-later """Generate the original PE32+ interactive fixture without an x86 toolchain. The guest polls host input via xenora.dll!input_poll() and updates its internal position: - input 1 (Right): column = (column + 1) % 4 - input 2 (Left): column = (column - 1) % 4 - other: column stays unchanged The guest then calls xenora.dll!frame_submit(column) and stops when the import returns 0, then halts. """ import argparse from pathlib import Path from struct import pack, pack_into def fixture(): base = 0x140000000 entry, imports = 0x1000, 0x2000 lookup = imports + 0x30 iat = imports + 0x50 module = imports + 0x70 sym_poll = imports + 0x80 sym_submit = imports + 0x90 data = bytearray(0x800) data[:2] = b"MZ" pack_into(" iat[0]: input_poll] code += b"\xff\x15" + pack(" iat[1]: frame_submit] code += b"\xff\x15" + pack("