Fix disassembly of calls/jmps and add docs for context

pull/23/merge
Zach Riggle 10 years ago
parent abd0a6854c
commit 969b3c4a39

@ -24,6 +24,8 @@ import pwndbg.vmmap
def context(*args):
"""
Print out the current register, instruction, and stack context.
Accepts subcommands 'reg', 'code', 'stack', 'backtrace', and 'args'.
"""
if len(args) == 0:
args = ['reg','code','stack','backtrace','args']

@ -13,7 +13,6 @@ capstone.CS_GRP_JUMP
def instruction(ins):
asm = u'%-06s %s' % (ins.mnemonic, ins.op_str)
branch = set(ins.groups) & capstone_branch_groups
# tl;dr is a branch?
@ -26,10 +25,10 @@ def instruction(ins):
# If it's a constant expression, color it directly in the asm.
if const and const != 0:
asm = asm.replace(hex(ins.target), target)
asm = asm.replace(hex(ins.target), sym or target)
if sym:
asm = '%-36s <%s>' % (asm, sym)
asm = '%-36s <%s>' % (asm, target)
# It's not a constant expression, but we've calculated the target
# address by emulation.

Loading…
Cancel
Save