iOS 汇编

875 阅读1分钟

寄存器 %rax %rdx rcx %rip  %rbp rsp rsi  rdi rdx r8~r15

rax 常作为函数返回值使用

rdi rsi rdx rcx r8 r9 存放函数参数

rsp rbp 用于栈操作

r开头64位 8字节

e开头32位 4字节

ax bx cx  16位 2字节

ah al :1字节

bh bl

movq $0xa  0x1ff7(%rip)  将0xa的值赋值给地址为%rip+0x1ff7的内存空间

movb

leaq  -0x18(%rbp),%rax    将rbp-0x18这个地址值赋值给rax

jmp  *%rdx              跳转到地址值执行      call和jmp写法类似

jmp 0x4001002

jmp *(%rax)

call 一般是函数  si  和return配合,执行然后回到原来位置



lldb常用指令

register read rip 读取寄出去地址

     rip = 0x000000010c0a04e1 UIKitCore`-[UIViewController loadViewIfRequired] + 1186

register write rip 10 写

x 0x00007ffeeaed7a88 读取内存中的值

x/3xw

3 指三组

x 16进制 f 浮点  d是十进制

w word 4字节  b byte   h half word 2字节  g giant word 8字节

s

ni

si

finish


rip - 减的 局部变了

rip+ 加的 全局变了