# 新规则的局部原ARM契约;不代替速度/真实动作矩阵。 # Local original-ARM contract of the new rule; does not replace the speed/real action matrix. import sys,struct,hashlib from pathlib import Path from unicorn import Uc,UC_ARCH_ARM64,UC_MODE_ARM,UC_HOOK_CODE from unicorn.arm64_const import * orig=Path(sys.argv[1]).read_bytes(); candidate=Path(sys.argv[2]).read_bytes() U,P,R,A,L=0x7001000,0x7002000,0x7003000,0x7004000,0x7005000 fails=[]; total=0 class Machine: def __init__(self,blob): self.u=u=Uc(UC_ARCH_ARM64,UC_MODE_ARM);u.mem_map(0,0x4000000);u.mem_write(0,blob);u.mem_map(0x7000000,0x20000) for addr,v in [(U+0x38,P),(P,R),(P+0x20,R),(R+0x18,A),(A+0x90,L)]:u.mem_write(addr,struct.pack('