# Runs the original image main+e10d30 directly; only the system queries and the resize callback are replaced, the consumer function is not rewritten. # Hand-written expectations: at the end of the message loop focus/op/perf each hold the current value; the target size corresponds to the performance mode; the same target is resized only once. import struct,itertools,hashlib,sys from pathlib import Path from unicorn import Uc,UC_ARCH_ARM64,UC_MODE_ARM,UC_HOOK_CODE from unicorn.arm64_const import * P=Path(sys.argv[1]);b=P.read_bytes() u=Uc(UC_ARCH_ARM64,UC_MODE_ARM);u.mem_map(0,0x4000000);u.mem_write(0,b);u.mem_map(0x7000000,0x2000);u.mem_map(0x7100000,0x10000) if sys.argv[2:] == ['--negative']: u.mem_write(0xe10e24,bytes.fromhex('1f2003d5')) # only in the negative control is the same-size skip removed, so repeated notifications resize repeatedly print('NEGATIVE: local copy of the original function, e10e24 b.eq→nop, the source image is unchanged') u.mem_write(0x3211718,struct.pack('