Docs and slightly better performance

pull/14/head
Zach Riggle 11 years ago
parent 9665afa67d
commit d61ebba69e

@ -10,25 +10,32 @@ import pwndbg.next
@pwndbg.commands.Command @pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning @pwndbg.commands.OnlyWhenRunning
def nextjmp(*args): def nextjmp(*args):
pwndbg.next.break_next_branch() """Breaks at the next jump instruction"""
if pwndbg.next.break_next_branch():
pwndbg.commands.context.context()
@pwndbg.commands.Command @pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning @pwndbg.commands.OnlyWhenRunning
def nextj(*args): def nextj(*args):
"""Breaks at the next jump instruction"""
nextjmp(*args) nextjmp(*args)
@pwndbg.commands.Command @pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning @pwndbg.commands.OnlyWhenRunning
def nextjump(*args): def nextjump(*args):
"""Breaks at the next jump instruction"""
nextjmp(*args) nextjmp(*args)
@pwndbg.commands.Command @pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning @pwndbg.commands.OnlyWhenRunning
def nextcall(*args): def nextcall(*args):
pwndbg.next.break_next_call() """Breaks at the next call instruction"""
if pwndbg.next.break_next_call():
pwndbg.commands.context.context()
@pwndbg.commands.Command @pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning @pwndbg.commands.OnlyWhenRunning
def nextc(*args): def nextc(*args):
"""Breaks at the next call instruction"""
nextcall(*args) nextcall(*args)

@ -4,6 +4,8 @@ import capstone
import collections import collections
from capstone import * from capstone import *
debug = False
groups = {v:k for k,v in globals().items() if k.startswith('CS_GRP_')} groups = {v:k for k,v in globals().items() if k.startswith('CS_GRP_')}
ops = {v:k for k,v in globals().items() if k.startswith('CS_OP_')} ops = {v:k for k,v in globals().items() if k.startswith('CS_OP_')}
access = {v:k for k,v in globals().items() if k.startswith('CS_AC_')} access = {v:k for k,v in globals().items() if k.startswith('CS_AC_')}
@ -40,6 +42,8 @@ class DisassemblyAssistant(object):
enhancer.enhance_symbol(instruction) enhancer.enhance_symbol(instruction)
enhancer.enhance_conditional(instruction) enhancer.enhance_conditional(instruction)
enhancer.enhance_next(instruction) enhancer.enhance_next(instruction)
if debug:
print(enhancer.dump(instruction)) print(enhancer.dump(instruction))
def enhance_conditional(self, instruction): def enhance_conditional(self, instruction):

@ -36,7 +36,7 @@ def break_next_branch(address=None):
ins = next_branch(address) ins = next_branch(address)
if ins: if ins:
gdb.Breakpoint("*%#x" % ins.address, temporary=True) gdb.Breakpoint("*%#x" % ins.address, internal=True, temporary=True)
gdb.execute('continue') gdb.execute('continue')
return ins return ins

Loading…
Cancel
Save