foundryzero / llef

LLEF is a plugin for LLDB to make it more useful for RE and VR
MIT License
336 stars 18 forks source link

Fixed a bug rendering disassembly when using `context` command #26

Closed XploitBengineer closed 7 months ago

XploitBengineer commented 7 months ago

This is a patch for a bug in LLEF where running context manually would cause the disassembly output to be incorrect. I do apologise, I had completely missed this when I put in the initial pr :sweat:

The below screenshots are an example of this: After an single step (si)

image

After running context

image

This is because LLDB does not denote the current instruction with -> in the SBExecutionContext object passed to the context command.

The patch slightly modifies the process of finding the current instruction in the disassembly, changing it from looking for the indicator arrow LLDB adds, to matching the current address as stored in the program counter. I don't think the performance drop should be too significant, as the older process was also a string comparison.