-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgdb-gef
76 lines (63 loc) · 1.13 KB
/
gdb-gef
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
#!/bin/sh
cat > ~/.gdbinit << "EOF"
source ~/gef/gef.py
source ~/Pwngdb/pwngdb.py
source ~/Pwngdb/angelheap/gdbinit.py
# don't stop the process when catch alarm signal
handle SIGALRM nostop print
# set follow-fork-mode parent
set detach-on-fork off
# show content of address using offset when PIE is enabled
define sbase
if $argc == 1
telescope $_base()+$arg0 10
end
if $argc == 2
telescope $_base()+$arg0 $arg1
end
end
# set breakpoints using offset when PIE is enabled
define bbase
b *($_base()+$arg0)
end
define dq
if $argc == 1
x /8gx $arg0
end
if $argc == 2
x /$arg1gx $arg0
end
end
define dd
if $argc == 1
x /16wx $arg0
end
if $argc == 2
x /$arg1wx $arg0
end
end
define dw
if $argc == 1
x /32hx $arg0
end
if $argc == 2
x /$arg1hx $arg0
end
end
define db
if $argc == 1
x /64bx $arg0
end
if $argc == 2
x /$arg1bx $arg0
end
end
# enable Pwngdb from https://github.com/scwuaptx/Pwngdb
define hook-run
python
import angelheap
angelheap.init_angelheap()
end
end
EOF
exec gdb "$@"