Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to revert one patched instruction rather than entire patch #5

Open
CaledoniaProject opened this issue Feb 15, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@CaledoniaProject
Copy link

The Revert action reverts everything I've edited, can you change this behavior?
It would be better to revert only the selected address range.

@gaasedelen
Copy link
Owner

It is actually possible to do partial reverts by selecting a range of the patch, and then right click -> revert.

Specifically, within the patch / preview UI, you can select a few characters on a single line of the instruction you want to revert, and right click revert that single instruction.

But reverting individual instructions is not always easy or intuitive, especially on architectures with mixed length instructions. Imagine you patch over a 5 byte instruction (say, a call instruction in x86) with a 3 byte instruction and a 2 byte instruction:

xor eax, eax
inc eax

If you revert inc eax .. what is the expected behavior? Restore the last two bytes of the call instruction that are now just garbage? If you chose to only show "revert instruction" in some cases but not others, it may become confusing/frustrating to users instead.

This is why I opted to make the default behavior to simply revert the entire contiguous patch. The fallback (range selection / partial reverts) was supposed to be the solution to this, but it's intentionally 'hidden' from users that might not know better.

PS: I noticed the single line range selection / revert is not working in the main IDA disass listing, but it does work within the patch preview window. I vaguely remember this being one of the bugs I found after release and wanted to fix but never got around to it.

@gaasedelen gaasedelen added the help wanted Extra attention is needed label Aug 17, 2024
@gaasedelen gaasedelen changed the title Revert one patch at a time Add the ability to revert one patched instruction rather than entire patch Aug 17, 2024
@gaasedelen gaasedelen added the enhancement New feature or request label Aug 17, 2024
gaasedelen added a commit that referenced this issue Aug 17, 2024
…ing individual instructions.

this aligns with the current / intended behavior of the patch preview UI.

related to #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants