pull/10/head
Zach Riggle 11 years ago
parent 86497b14aa
commit d1743d7a87

@ -7,6 +7,9 @@ import pwndbg.commands
@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def auxv():
"""
Print information from the Auxiliary ELF Vector.
"""
for k,v in pwndbg.auxv.get().items():
if v is not None:
print(k.ljust(24), v if not isinstance(v, (long, int)) else pwndbg.chain.format(v))

@ -16,6 +16,9 @@ import pwndbg.vmmap
@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def context(*args):
"""
Print out the current register, instruction, and stack context.
"""
if len(args) == 0:
args = ['reg','code','stack','backtrace']

@ -8,6 +8,11 @@ import pwndbg.vmmap
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def dt(typename, address=None):
"""
Dump out information on a type (e.g. ucontext_t).
Optionally overlay that information at an address.
"""
if address is not None:
address = pwndbg.commands.fix(address)
print(pwndbg.dt.dt(typename, addr=address))

@ -7,7 +7,12 @@ import pwndbg.regs
@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def hexdump(address=None, count=64):
"""Hexdumps some data"""
"""
Hexdumps data at the specified address.
Optionally provide the number of bytes to dump (default 64)
Note that repeating rows are collapsed.
"""
address = int(address or pwndbg.regs.sp)
count = int(count)

@ -8,6 +8,9 @@ import pwndbg.regs
@pwndbg.commands.OnlyWhenRunning
@pwndbg.events.stop
def j(*args):
"""
Synchronize IDA's cursor with GDB
"""
pc = int(gdb.selected_frame().pc())
pwndbg.ida.Jump(pc)
@ -15,10 +18,15 @@ def j(*args):
if pwndbg.ida.available():
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def up():
def up(n=1):
"""
Select and print stack frame that called this one.
An argument says how many frames up to go.
"""
f = gdb.selected_frame()
o = f.older()
for i in range(n):
o = f.older()
if o:
o.select()
@ -29,10 +37,15 @@ if pwndbg.ida.available():
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def down():
def down(n=1):
"""
Select and print stack frame called by this one.
An argument says how many frames down to go.
"""
f = gdb.selected_frame()
o = f.newer()
for i in range(n):
o = f.older()
if o:
o.select()

@ -10,6 +10,9 @@ import pwndbg.vmmap
@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def nearpc(pc=None, lines=None, to_string=False):
"""
Disassemble near a specified address.
"""
# Fix the case where we only have one argument, and
# it's a small value.
if lines is None and (pc is None or int(pc) < 0x100):

Loading…
Cancel
Save