LLDBX

LLDB eXtended for macOS & iOS

Supercharge your LLDB experience with advanced commands, colorized output, and structure introspection. No dependencies required.

macOS iOS
View on GitHub

Installation

cd
wget https://raw.githubusercontent.com/DimitriFourny/lldbx/refs/heads/main/lldbx.py
echo 'command script import "~/lldbx.py"' > ~/.lldbinit

Features

Command Description
analyzeAnalyze a function and show a more readable disassembled version.
brAdd a breakpoint on an address or a symbol.
hexdumpHexadecimal dump.
confConfigure global settings.
memsetmemset equivalent primitive.
memcpymemcpy equivalent primitive.
nopacRemove PAC from a pointer.
poffsetsPrint class and structure offsets.
shared_cacheDisplay information about the shared cache.
telescopeDereference the addresses.
xinfoDisplay information about an address.

Example Output

------------------------------------------------------------------- registers --

x8 : 0x0

sp : 0x16fdfeea0

----------------------------------------------------------------------- stack --

0x16fdfeea0|+0x00: 0x202068150 -> lsl::sPoolBytes+0x60

0x16fdfeea8|+0x08: 0x202068018 -> lsl::sMemoryManagerBuffer

0x16fdfeeb0|+0x10: 0xfffffff0009d5d6

0x16fdfeeb8|+0x18: 0x16fdfef68

0x16fdfeec0|+0x20: 0x202068018 -> lsl::sMemoryManagerBuffer

0x16fdfeec8|+0x28: 0x2020680b0 -> lsl::sAllocatorBuffer

0x16fdfeed0|+0x30: 0x16fdff520

0x16fdfeed8|+0x38: 0x193e36b98 -> start+0x17bc

------------------------------------------------------------------------ code --

test`main:

0x10000053c: stp x29, x30, [sp, #0x30]

0x100000540: add x29, sp, #0x30

0x100000544: mov w8, #0x0 ; =0

-> 0x100000548: str w8, [sp, #0xc]

0x10000054c: stur wzr, [x29, #-0x4]

0x100000550: add x0, sp, #0x10

0x100000554: bl 0x100000570 ; A::A()

0x100000558: ldr w0, [sp, #0xc]

0x10000055c: mov w8, #0xa ; =10

------------------------------------------------------------------------ info --

Process 1783 stopped

* thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over

frame #0: 0x0000000100000548 test`main + 16

Target 0: (test) stopped.

(lldb) analyze $pc

test`main:

0x100000538: sub sp, sp, #0x40

0x10000053c: stp x29, x30, [sp, #0x30]

0x100000540: add x29, sp, #0x30

0x100000544: mov w8, #0x0 ; =0

-> 0x100000548: str w8, [sp, #0xc]

0x10000054c: stur wzr, [x29, #-0x4]

0x100000550: add x0, sp, #0x10

0x100000554: bl 0x100000570 ; A::A()

0x100000558: ldr w0, [sp, #0xc]

0x10000055c: mov w8, #0xa ; =10

0x100000560: str w8, [sp, #0x18]

0x100000564: ldp x29, x30, [sp, #0x30]

0x100000568: add sp, sp, #0x40

0x10000056c: ret

(lldb) hexdump $x9

20206cb60: 70 80 06 02 02 00 00 00 50 31 46 50 41 54 50 0d p.......P1FPATP.

20206cb70: 00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 ................

20206cb80: 90 86 06 02 02 00 00 00 e8 f6 df 6f 01 00 00 00 ...........o....

20206cb90: 0d 00 00 01 1a 00 00 00 e4 55 6a 03 00 00 00 00 .........Uj.....

(lldb) telescope $x9+0x10 0x20206cb70|+0x00: 0x100000000 -> _mh_execute_header 0x20206cb78|+0x08: 0x100000000 -> _mh_execute_header 0x20206cb80|+0x10: 0x202068690 -> '/Users/df0/Documents/projects/lldbx/test/test' 0x20206cb88|+0x18: 0x16fdff6e8 -> '/Users/df0/Documents/projects/lldbx/test/test' 0x20206cb90|+0x20: 0x1a0100000d 0x20206cb98|+0x28: 0x36a55e4 0x20206cba0|+0x30: 0x7e80500000f0500 0x20206cba8|+0x38: 0x7e80000000f0000

(lldb) xinfo $x9 Symbol: lsl::sPoolBytes+0x4a70 Page: 0x202068000 -> 0x20208c000 (size = 0x24000) Mapped: Yes Permissions: r-- Module: /usr/lib/dyld Section: __allocator

(lldb) poffsets A

+0x000 A {

  +0x008 int     num1

  +0x00c int     num2

  +0x010 B      classB

    +0x010 unsigned int b1

    +0x014 unsigned int b2

};