Comment out a line of code from a compiled .exe?

I license a game engine so have to use a compiled exe to run my app.

I know about a line of code in the source that is causing a lot of unnecessary compute overhead (I have the source but cannot compile myself due to other libraries included in my current licensed exe).

How can modify the .exe to comment out one particular line. Or unset a particular #define?

Thanks in advance.
You can't. For a native C++ application, when a executable is created, all that's left are the assembly instructions. The best you can do is some reverse-engineering with the assembly to pinpoint which instructions you want to remove or modify (and I don't know the specifics of low-level assembly). Probably easier to re-compile.
Last edited on
Unfortunately I cannot recompile because (although I do have the source), I don't have the source for some other libraries that are included in the licensed .exe.

Given that i do have the source code though, how could I use that to detect which instructions to set to NOP?
you can hex edit it out if you know what you are doing, or hack on it in other ways. this could be a violation of their terms, though.

you may also be able to request them to compile it with that define off for you.
Registered users can post here. Sign in or register to post.