sbl_uni: txt trap page-wide 802F600 + sp/lr triplet

This commit is contained in:
SashegDev
2026-09-15 00:27:40 +00:00
parent 79dcc016b4
commit 521c8e5398
+8 -5
View File
@@ -340,13 +340,16 @@ def main():
mu.hook_add(UC_HOOK_CODE, hook_code)
_txtlog = []
def hook_txt(mu, access, addr, size, value, data):
if len(_txtlog) < 10:
if len(_txtlog) < 12:
try:
from unicorn.arm_const import UC_ARM_REG_PC as _P
_txtlog.append((count[0], mu.reg_read(_P), addr, size, value))
from unicorn.arm_const import UC_ARM_REG_SP as _Q
from unicorn.arm_const import UC_ARM_REG_LR as _L
_txtlog.append((count[0], mu.reg_read(_P), addr, size, value,
mu.reg_read(_Q), mu.reg_read(_L)))
except Exception:
pass
mu.hook_add(UC_HOOK_MEM_WRITE, hook_txt, begin=0x802F664, end=0x802F668)
mu.hook_add(UC_HOOK_MEM_WRITE, hook_txt, begin=0x802F600, end=0x802F700)
_splog2 = []
def hook_spck(mu, addr, size, data):
try:
@@ -361,8 +364,8 @@ def main():
import atexit as _ax3
def _dtx():
print('txt-writes:', len(_txtlog))
for n, pc, a, sz, v in _txtlog:
print(' insn', n, hex(pc), hex(a), sz, hex(v))
for n, pc, a, sz, v, sp, lr in _txtlog:
print(' insn', n, hex(pc), hex(a), sz, hex(v), hex(sp), hex(lr))
print('sp-trips:', len(_splog2))
for n, pc, sp in _splog2:
print(' insn', n, hex(pc), hex(sp))