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

Add a `context` command, allowing for manual refreshing/printing of the LLEF UI #18

Closed XploitBengineer closed 9 months ago

XploitBengineer commented 10 months ago

Hi guys,

This PR is a proposition to add a new command to LLEF, context, that allows a user to manually trigger a refresh and reprint of the main LLEF menu. An example use of this would be when switching frames and wanting to refresh the LLEF UI for the newly selected frame. I just chose the verb context because that is what PwnDbg uses.

The first commit essentially suggests an implementation of this command, using mostly duplicated code from the stop_hook class to reprint the information.

In the second commit I refactored the stop_hook and ContextCommand to share the same class, ContextHandler. This was purely to avoid code duplication.

Let me know what you guys think, I'm open to ideas of better ways of implementing this as well.