Description
Is your feature request related to a problem? Please describe.
An easier way to create/manage/remove patched bytes.
Current flow issues:
Being allowed to edit bytes that are code, is prohibited for some reason, patching instructions is your only way.
Patching an instruction itself is great, it adjust the code flow, reprocesses the C++ as well.
Now leave the project for a week, and see if you can remember what you patched and where, and what the original opcodes were.
Even if you had a backup of your file, Ghidra remembered your patch somewhere, and will refuse to show the old opcodes.
Describe the solution you'd like
- Allow people to edit bytes marked as code. I am not sure why this is blocked by default and has no option i could find to turn it off.
- Since patches are stored somewhere anyway, might as well make a view somewhere that shows what patches were made, old bytes/new bytes, old operator(s) new operator(s).
- Allow the reversing of said patches as well, to make the undo of a patch you were testing out easier to do.
Current flow for restoring a patch that is no longer in Undo: Clear marking of code, restore old bytes since you forgot the old opcodes most likely in the bytes window, then select the whole function and ask ghidra to "Clear flow and repair" which is not that obvious a path. (which i am not even sure correctly works all the time)
Describe alternatives you've considered
I would edit my bytecode outside of Ghidra, but like i said, Ghidra doesn't care much about this change, and any patches you did in ghidra will come out on top of whatever the underlying file says it should be. Resulting in a disconnect in what the bytecode actually is. Debugging would be problematic, and C++ previews broken or unusable from that point onward.