cutter icon indicating copy to clipboard operation
cutter copied to clipboard

Highlighting respective Disassembly-Decompiler code for multiline selection

Open s0i37 opened this issue 5 years ago • 5 comments

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

If I select multiple lines in decompiler I want that respective instructions will be selected too like this:

2

And vice versa - instructions -> decompiler

Currently nothing happens when I highlight multiple lines:

1

Describe the solution you'd like

Ghidra/r2dec/retdec provide offset information in decompiled code, use it to show the respective lines when highlighting.

s0i37 avatar Dec 22 '20 17:12 s0i37

Hey! Thanks for the issue :) Currently, Cutter has a line-to-line synchornization between the decompiler and the disassembly. so if you will click on a line on the decompiler, or even part of a line, you will see that the instrcution in the disassembly shows it as well.

So imagine you will have a line like: somefunction(37, 120);

If you will click on someFunction you will see that the disassembly highlights call someFunction. If you will click on 120 you will see that the disassembly highlights push 120.

Now, regarding multi-selection of lines, this is not implemented yet and this is indeed a good idea. What means, that when a user select multiple lines in the decompiler, Cutter will show the multiple assembly instructions that respectively responsible for these lines.

Please clarify if this is what you meant :)

ITAYC0HEN avatar Dec 24 '20 09:12 ITAYC0HEN

Yes. I really meant it. The good example of my idea - is Ghidra SRE.

s0i37 avatar Dec 24 '20 09:12 s0i37

Thanks @s0i37! Updated the title and the desription to make it more clear

ITAYC0HEN avatar Dec 24 '20 10:12 ITAYC0HEN

Related to #1708 although for that I initially planned having single range. Decompiler output might require multiple ranges as things like loop header which is consecutive piece of C code might be split into multiple parts of assembly code. The simplest approach of ignoring that and taking min max range values could cause highlighting disassembly of whole loop.

karliss avatar Dec 24 '20 13:12 karliss

ping

s0i37 avatar Jan 18 '24 18:01 s0i37