Hide repeated instructions at the end of disassembly (#205)

pull/216/head
Zach Riggle 9 years ago committed by GitHub
parent 832b8e7b73
commit 73d1cfd51f

@ -226,4 +226,12 @@ def near(address, instructions=1, emulate=False):
if insn:
insns.append(insn)
# Remove repeated instructions at the end of disassembly.
# Always ensure we display the current and *next* instruction,
# but any repeats after that are removed.
#
# This helps with infinite loops and RET sleds.
while insns and len(insns) > 2 and len(set(insns[-3:])) == 1:
del insns[-1]
return insns

Loading…
Cancel
Save