Merge pull request #126 from quangnh89/master
Set breakpoint at RVA from PIE base.
This commit is contained in:
commit
d5fab8bf66
21
peda.py
21
peda.py
|
@ -4417,6 +4417,26 @@ class PEDACmd(object):
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def breakrva(self, *arg):
|
||||||
|
"""
|
||||||
|
Set breakpoint by Relative Virtual Address (RVA)
|
||||||
|
Usage:
|
||||||
|
MYNAME rva
|
||||||
|
MYNAME rva module_name (e.g binary, shared module name)
|
||||||
|
"""
|
||||||
|
(rva, module) = normalize_argv(arg, 2)
|
||||||
|
if rva is None or not to_int(rva):
|
||||||
|
self._missing_argument()
|
||||||
|
if module is None:
|
||||||
|
module = 'binary'
|
||||||
|
|
||||||
|
binmap = peda.get_vmmap(module)
|
||||||
|
if len(binmap) == 0:
|
||||||
|
print ("%s not found" % module)
|
||||||
|
else:
|
||||||
|
base_address = binmap[0][0]
|
||||||
|
peda.set_breakpoint(base_address+rva)
|
||||||
|
return
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Memory Operation Commands #
|
# Memory Operation Commands #
|
||||||
|
@ -6146,6 +6166,7 @@ Alias("jtrace", "peda traceinst j")
|
||||||
Alias("stack", "peda telescope $sp")
|
Alias("stack", "peda telescope $sp")
|
||||||
Alias("viewmem", "peda telescope")
|
Alias("viewmem", "peda telescope")
|
||||||
Alias("reg", "peda xinfo register")
|
Alias("reg", "peda xinfo register")
|
||||||
|
Alias("brva", "breakrva")
|
||||||
|
|
||||||
# misc gdb settings
|
# misc gdb settings
|
||||||
peda.execute("set confirm off")
|
peda.execute("set confirm off")
|
||||||
|
|
Loading…
Reference in New Issue