mirror of
https://github.com/AsahiLinux/m1n1
synced 2025-02-16 21:58:27 +00:00
proxyutils.py: Add disassemble_at() method
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
e3d7e569dc
commit
9bfe278f52
1 changed files with 11 additions and 0 deletions
|
@ -117,6 +117,17 @@ class ProxyUtils(object):
|
|||
print(f"Pushing ADT ({adt_size} bytes)...")
|
||||
self.iface.writemem(adt_base, self.adt_data)
|
||||
|
||||
def disassemble_at(self, start, size, pc=None):
|
||||
code = struct.unpack(f"<{size // 4}I", self.iface.readmem(start, size))
|
||||
|
||||
c = ARMAsm(".inst " + ",".join(str(i) for i in code), start)
|
||||
lines = list(c.disassemble())
|
||||
if pc is not None:
|
||||
idx = (pc - start) // 4
|
||||
lines[idx] = " *" + lines[idx][2:]
|
||||
for i in lines:
|
||||
print(" " + i)
|
||||
|
||||
def print_exception(self, code, ctx):
|
||||
print(f" == Exception taken from {ctx.spsr.M.name} ==")
|
||||
el = ctx.spsr.M >> 2
|
||||
|
|
Loading…
Add table
Reference in a new issue