15.5.1. gdb¶
15.5.1.1. gdb¶
- BreakPoint 断点
break [PROBE_MODIFIER] [LOCATION] [thread THREADNUM] [if CONDITION]
- 设置断点
break *0x080483d0
在内存0x080483d0处下断点break <func name>
在函数处下断点break *<func name> + 4
在函数偏移处下断点
- 相关操作
c
从断点处继续运行d[elete] 1
删除断点1d 1 2
删除断点1 2d
删除所有断点dis[able] 1
Disable breakpoint 1en[able] 1
Enable breakpoint 1
c[ontinue]
运行至下一个断点或程序结束command
设置断点的命令disas <func name>
反汇编函数fin[ish]
跳出当前函数 / 循环i
infoi b
breakpoints infoi f
frame infoi s
stack info
ignore <break_list> count
break_list所指定的断点号将被忽略count次
n
/next
单步运行p <func name>
找函数地址r <param>
从头开始运行s
/step
单步运行 遇到调用时深入file
加载文件x/nfu address
打印内存n
表示要显示的内存单元的个数f
表示显示方式x
按十六进制格式显示变量。d
按十进制格式显示变量。u
按十进制格式显示无符号整型。o
按八进制格式显示变量。t
按二进制格式显示变量。a
按十六进制格式显示变量。i
指令地址格式c
按字符格式显示变量。f
按浮点数格式显示变量。
u
表示一个地址单元的长度b
表示单字节h
表示双字节w
表示四字节g
表示八字节
地址可以是内存地址或者是寄存器
15.5.1.2. gdb-peda¶
aslr
show aslr settingchecksec
Check for various security options of binarydumpargs
Display arguments passed to a function when stopped at a call instructiondumprop
Dump all ROP gadgets in specific memory rangeelfheader
Get headers information from debugged ELF fileelfsymbol
Get non-debugging symbol information from an ELF filelookup
Search for all addresses/references to addresses which belong to a memory rangepatch
Patch memory start at an address with string/hexstring/intpattern
Generate, search, or write a cyclic pattern to memorypattern_create 200
生成一段长度为200的字符串pattern_offset 0x223333
在0x223333的位置根据匹配找溢出的字节数
procinfo
Display various info from /proc/pid/pshow
Show various PEDA options and other settingspset
Set various PEDA options and other settingsreadelf
Get headers information from an ELF fileropgadget
Get common ROP gadgets of binary or libraryropsearch
Search for ROP gadgets in memorysearchmem|find
Search for a pattern in memory; support regex searchshellcode
Generate or download common shellcodes.skeleton
Generate python exploit code templatevmmap
Get virtual mapping address ranges of section(s) in debugged processxormem
XOR a memory region with a key