1. gdb disass
  2. rust day 2

gdb disass

disass /s addr 或者 /m 显示汇编和源码位置

disass /b 或者 /r 显示汇编、和对应的opcode

pwndbg> disass /r  0x7ffff7867e41,+10
Dump of assembler code from 0x7ffff7867e41 to 0x7ffff7867e4b:
=> 0x00007ffff7867e41 <__GI___libc_read+17>:    48 3d 00 f0 ff ff       cmp    rax,0xfffffffffffff000
   0x00007ffff7867e47 <__GI___libc_read+23>:    77 57                   ja     0x7ffff7867ea0 <__GI___libc_read+112>
   0x00007ffff7867e49 <__GI___libc_read+25>:    c3                      ret
   0x00007ffff7867e4a <__GI___libc_read+26>:    66 0f 1f 44 00 00       nop    WORD PTR [rax+rax*1+0x0]
End of assembler dump.

机器代码(使用GDB调试) — Machine Code (Debugging with GDB)

rust day 2

函数会隐式返回 () ,如果没有指明的话