GJDuck / e9patch

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

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

Closed heagoo closed 11 months ago

heagoo commented 11 months 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 11 months 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 11 months ago

Closed as answered.