Small fix to annotations crash (#2346)

* Small fix to remove crash in specific cases - when we generate an annotation on an instruction detected to change the program counter (which sometimes happens, like an add instruction where the pc is the target in Arm)

* fix for real
pull/2347/head
OBarronCS 1 year ago committed by GitHub
parent fe1f1fa04a
commit 6b85347806
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -134,7 +134,8 @@ def instructions_and_padding(instructions: List[PwndbgInstruction]) -> List[str]
# Final pass to apply final paddings to make alignment of blocks of instructions cleaner
for i, (ins, asm, padding) in enumerate(zip(instructions, result, paddings)):
if ins.annotation:
# Padding being None implies a jump target - this is already baked into "asm"
if ins.annotation and padding is not None:
asm = f"{ljust_colored(asm, padding)}{ins.annotation}"
final_result.append(asm)

Loading…
Cancel
Save