rizinorg / rizin

UNIX-like reverse engineering framework and command-line toolset.
https://rizin.re
GNU Lesser General Public License v3.0
2.71k stars 362 forks source link

Refresh screen key binding / trigger #3908

Open ctlayon opened 1 year ago

ctlayon commented 1 year ago

The r key is bound to both rotate and refresh so in order to update my screen after applying afn I have to press r four times.

  1. Starting point image
  1. After I rename the flag data.1800016f0 and remove the data flag there is no screen refresh so the data flag is still visible
  2. In order to trigger a refresh I currently press the r key which cycles through your quick jumps. I have to press it four times to get back to the original settings. alternatively, i sometimes q and then V again which may cause my screen to go to the top of the bb instead of staying at where i've currently scrolled to so prefer to press r four times.

I think there previously was a refresh key binding to r that would refresh the current screen after applying function name changes. I would love to have this be brought back as a separate key-binding, maybe <ctrl>+r, or perhaps alternatively have the refresh trigger whenever afn / afvn / f- /f+ is typed by a user.

ret2libc commented 1 year ago

How do you rename the flag? If you use dr from within the visual graph mode it should sync.

Anyway, the problem is that most changes performed while in graph mode are not immediately synced. Doing that would require re-computing the whole graph, which might be slow on some big functions. This is also because we don't have a nice way to signal which operations actually change something in the disassembly and which do not.

Some solutions we could have:

ctlayon commented 1 year ago

If I try dr from visual mode I get an error message. The message quickly disappears so I can't capture it in a screenshot, this is from latest release on both mac and linux (debian, arch):

Oddly i get a same error message / disappearing quickly behaviors if i try to use the highlighting command (/)on both mac / linux in visual mode as well.

To rename the function I typically do (af first if not defined):

af @ <OFFSET>; afn MainThread @ <OFFSET>

I think the prompting would be more annoying then worth and the edge cases would be weird to handle so I think my preference would be to implement the refresh key. idk how the r command works but as long as the refresh command works the same way as pressing r key four times currently does I would be very happy. I.e.:

ctlayon commented 1 year ago

Stellar, just updated and now / command works with no errors! And I am able to define the functions using df / dr!

ret2libc commented 1 year ago

THis is not fully solved though, is it?

ctlayon commented 1 year ago

Yeah correct still have to press r four times to refresh if I'm doing afn!