rizinorg / cutter

Free and Open Source Reverse Engineering Platform powered by rizin
https://cutter.re
GNU General Public License v3.0
15.9k stars 1.15k forks source link

Nicer displaying of 1 instruction loops #3369

Open karliss opened 3 months ago

karliss commented 3 months ago

Is your feature request related to a problem? Please describe.

When displaying jump lines (or whatever the name for lines to the left of disassembly are called) for instructions that jump to themselves (infinite loop).

image

I initially thought the line drawing code has bugged out. Took me a couple of seconds to read the disassembly until I realized what's going on.

Describe the solution you'd like

Add special case in the drawing code when instruction jumps to itself, maybe draw a loop arrow icon similar to image

As a side effect it would also help more easily identify such single instruction infinite loops. For me that doesn't seem too important since normal code would rarely contain such (possibly infinite) loops although it shouldn't hurt either. I have mostly seen them in interrupt vector handlers on embedded software. There might be cases on some architectures where you can make more meaningful loops out of single instruction, but nothing comes to my mind right now. My primary motivation is to avoid drawing something that looks like drawing code is broken.

Describe alternatives you've considered

Slightly offset start end/of such arrows resulting in something like: image Didn't we have something like that before? I though I have seen it , but I might be remembering it wrong. Or maybe those were jumps 1 instruction forward/back.

Additional context

Rohan-here commented 2 months ago

can i work on this?

wargio commented 2 months ago

sure.