Show "x" when the condition instruction will not be taken (#74)

* Remove bad attribute and make DisassemblyAssistant().dump() work

* Make the default value of condition() in DisassemblyAssistant is None

* Show "x" when the condition instruction will not be taken

* Explict check 'is None'
pull/72/merge
MengHuan Yu 10 years ago committed by Zach Riggle
parent 5028f69ce5
commit 6c04e5368e

@ -76,7 +76,7 @@ class DisassemblyAssistant(object):
instruction.condition = c
def condition(self, instruction):
return False
return None
def enhance_next(self, instruction):
"""
@ -248,7 +248,7 @@ class DisassemblyAssistant(object):
for i, op in enumerate(ins.operands):
rv.append(' operands[%i] = %s' % (i, ops.get(op.type, op.type)))
rv.append(' access = %s' % (access.get(op.access, op.access)))
#rv.append(' access = %s' % (access.get(op.access, op.access)))
if op.int is not None:
rv.append(' int = %#x' % (op.int))

@ -42,7 +42,7 @@ class DisassemblyAssistant(pwndbg.disasm.arch.DisassemblyAssistant):
return None
if instruction.address != pwndbg.regs.pc:
return False
return None
cpsr = pwndbg.regs.cpsr

@ -59,9 +59,11 @@ def instruction(ins):
asm = asm.replace(ins.mnemonic, pwndbg.color.bold(ins.mnemonic))
# If we know the conditional is taken, mark it as green.
if ins.condition:
if ins.codition is None:
asm = ' ' + asm
elif ins.condition:
asm = pwndbg.color.green(u'') + asm
else:
asm = ' ' + asm
asm = pwndbg.color.red(u'') + asm
return asm

@ -132,7 +132,7 @@ class DisassemblyAssistant(pwndbg.disasm.arch.DisassemblyAssistant):
# We can't reason about anything except the current instruction
if instruction.address != pwndbg.regs.pc:
return False
return None
efl = pwndbg.regs.eflags

Loading…
Cancel
Save