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): def context(*args):
""" """
Print out the current register, instruction, and stack context. Print out the current register, instruction, and stack context.
Accepts subcommands 'reg', 'code', 'stack', 'backtrace', and 'args'.
""" """
if len(args) == 0: if len(args) == 0:
args = ['reg','code','stack','backtrace','args'] args = ['reg','code','stack','backtrace','args']

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

Loading…
Cancel
Save