cutter icon indicating copy to clipboard operation
cutter copied to clipboard

Undo edit instructions

Open numin0us opened this issue 5 years ago • 3 comments

Is your feature request related to a problem? Please describe. I think it would be useful if Cutter had the ability to undo edits made to a binary. It may also be useful to warn users before using the feature that there is no undo, and that any changes made in write mode will be permanent. I'm aware that most(?) decompilers do not have this feature but there are a few plugins which do allow for this functionality in IDA and such.

numin0us avatar Jul 25 '19 01:07 numin0us

I propose an edit system where changes to the loaded binary will be saved via a) an internal git-repository. b) an interface to an external git-repository.

When the user triggers an undo, the previous state can be restored via git. I currently use this setup myself manually. Besides some little issues where a fix can easily be implemented (see #2469) this works quite well.

It has to be noted, that without further improvements this still requires recalculating the view (disasm, decomp, ...).

When implemented, one can add a feature for also storing such view states and their changes to quick-load them respectively. I'd rather implement those features separately though, as this reduces complexity during coding and yields faster working results.

Semnodime avatar Nov 21 '21 18:11 Semnodime

I'll probably play a little with the Cutter python api and try to convert my current manual setup into some plugin. In case somebody tries to do the same, please let me know, so we can collab on this together.

Semnodime avatar Nov 21 '21 18:11 Semnodime

Honestly I am not sure git is the best option when it comes to binary diffing. Overall I think this problem is not trivial but I also think using a git backend is not the proper way to address it.

xarkes avatar Nov 27 '21 09:11 xarkes