# 直接跑原映像 main+e10d30;只替换系统查询与resize回调,不重写消费函数。 # 手写期望:消息循环结束focus/op/perf各为当前值;目标尺寸对应性能档;相同目标仅resize一次。 # 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')) # 只在负对照中移除尺寸相同跳过,重复通知会重复resize | only in the negative control is the same-size skip removed, so repeated notifications resize repeatedly print('NEGATIVE:本地原函数副本e10e24 b.eq→nop,不改资源正本') u.mem_write(0x3211718,struct.pack('