mirror of https://github.com/commaai/tinygrad.git
qcom fix disasm (#6703)
This commit is contained in:
parent
a473bf4ba9
commit
ca66b11e07
|
@ -1,6 +1,7 @@
|
|||
import ctypes
|
||||
import os
|
||||
import pathlib
|
||||
import struct
|
||||
from hexdump import hexdump
|
||||
|
||||
fxn = None
|
||||
|
@ -14,7 +15,8 @@ def disasm_raw(buf):
|
|||
fxn(buf, len(buf))
|
||||
|
||||
def disasm(buf):
|
||||
END = b"\x00\x00\x00\x00\x00\x00\x00\x03"
|
||||
buf = buf[0x510:] # this right?
|
||||
buf = buf.split(END)[0] + END
|
||||
disasm_raw(buf)
|
||||
def _read_lib(off): return struct.unpack("I", buf[off:off+4])[0]
|
||||
|
||||
image_offset = _read_lib(0xc0)
|
||||
image_size = _read_lib(0x100)
|
||||
disasm_raw(buf[image_offset:image_offset+image_size])
|
||||
|
|
Loading…
Reference in New Issue