"""Diff LIVE flash (via the DF aperture) against our archived image. Any region that differs is runtime-mutable state -- anti-rollback counters, secure NVRAM, RAS EEPROM records, event logs. Those are regions the PSP writes and trusts, which makes them interesting targets. READ-ONLY. No SPI commands. SMN reads are slow over USB (~3 transactions per dword), so this samples rather than dumping 1 MB. """ import sys, struct, time sys.path.insert(0,"/Users/user/src/tinygrad") from tinygrad import Device d=Device["AMD"]; adev=d.iface.dev_impl def rd(a): adev.wreg(14,a&0xffffffff); return adev.rreg(15) BASE=0xd800000; FOFF=0x20000; SPAN=0xe0000 # verified linear region fl=open('flash_BIOS2_KNOWNGOOD_20260917.bin','rb').read() def chunk(delta, n=8): return b"".join(struct.pack('") print(" no runtime-mutable region detected in [%#x,%#x)"%(FOFF,FOFF+SPAN)) print("\n=== also probe the region BELOW the aperture start (flash 0..0x20000) ===") B2=0xd300000 # maps flash 0x0 for delta in range(0, 0x20000, 0x2000): live=b"".join(struct.pack('