-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgdbinit
88 lines (76 loc) · 1.58 KB
/
gdbinit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
source ~/.peda/peda.py
#source ~/.pwndbg/gdbinit.py
source ~/.pwngdb/pwngdb.py
source ~/.pwngdb/angelheap/gdbinit.py
python
import angelheap
config.Option.set("pagesize", 0)
config.Option.set("context", "all")
config.Option.set("session", "~/.peda/sessions/peda-session-#FILENAME#.txt")
end
# When inspecting large portions of code the scrollbar works better than 'less'
set pagination off
# Keep a history of all the commands typed. Search is possible using ctrl-r
set history save on
set history filename ~/.gdb_history
set history size 32768
set history expansion on
set prompt \001\033[38;5;214m\002[gdb]\$ \001\033[m\002
alias heapls = parseheap
define hook-run
python
angelheap.init_angelheap()
end
end
# Custom functions
define preload
if $argc != 1
set environment LD_PRELOAD=
else
set environment LD_PRELOAD=$arg0
end
end
document preload
Set LD_PRELOAD environment variable
preload <library path>
end
define re
if $argc == 0
target remote localhost:4444
else
target remote localhost:$arg0
end
end
document re
Remote debug
re <port>
end
define tret
stepuntil ret
end
document tret
Step until ret instruction
end
define tcall
stepuntil tcall
end
document tcall
Step until call instruction
end
define gg
# if $arg0 == 64
# set env LD_LIBRARY_PATH=/dbg64
# else
# set env LD_LIBRARY_PATH=/dbg32
# end
python
arch = getarch()
if arch == 'i386':
gdb.execute('set env LD_LIBRARY_PATH=/dbg32')
else:
gdb.execute('set env LD_LIBRARY_PATH=/dbg64')
end
end
document gg
Replace libc with a debug version
end