import lief
p = r'E:\ios\dump_tool\out\Payload\Driver.app\Driver'
b = lief.MachO.parse(p).at(0)
want = [0x10190bd20, 0x10190bd2c, 0x10190bccc, 0x10190c5d8, 0x10190c5f0,
        0x10190c680, 0x10190c8e4, 0x10190b21c, 0x10190b204, 0x10190836c,
        0x10190c860, 0x10190c818]
mp = {}
for x in b.bindings:
    mp[x.address] = str(x.symbol.name)
# stubs section: each stub is 12 bytes (adrp/ldr/br) and the binding is on the ldr's got addr,
# so also map stub addr by scanning __stubs for the adrp target
for a in want:
    print(hex(a), mp.get(a, '-'))
print('--- stub table')
sec = None
for s in b.sections:
    if s.name == '__stubs':
        sec = s
print(sec)
