GJDuck / e9patch

A powerful static binary rewriting tool
GNU General Public License v3.0
986 stars 67 forks source link

[question] How to replace instruction if I only know the binary code of both instructions? #71

Closed heagoo closed 12 months ago

heagoo commented 1 year ago

I need to replace instruction_1 to instruction_2, I know the binary code of both instructions. What's the command should I use? Thank you!

GJDuck commented 1 year ago

You should be able to match the binary code using bytes[i], e.g.:

    $ ./e9tool -M 'bytes[0] == 0x0F && bytes[1] == 0x0B' -P ...

Replacing instructions between other instructions is not really supported via the command-line interface. For something like this, you may need to use an E9Tool plugin.

GJDuck commented 12 months ago

Closed as answered.