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 issue with code view when running context command. #27

Closed XploitBengineer closed 7 months ago

XploitBengineer commented 7 months ago

Sorry I missed this in the initial pr. Previously, using the context command would cause llef to render the disassembly the current instruction being the start of the frame, rather than at a frame offset. Thanks to @jthorpe6 for spotting this.

When reaching an instruction by stepping (si)

image

When running context, on that instruction

image

This is because the display_code function looked for the presence of an arrow marker to denote the current instruction, however this is not present in the SBExecutionContext that is passed via the context command. To fix this, the patch identifies the current instruction by comparing the disassembly addresses to the current PC

stephen-f0 commented 7 months ago

Thanks for the fix @XploitBengineer - this is a much nicer way of getting the current instruction. Tested on a bunch of architectures with no problems.