1

I have a PE which I'd like to edit. I know I can create patches in OllyDbg and similar tools, but they all have one thing in common: I have to overwrite some present code in file. I wonder if it is possible to somehow enlarge the executable, put the code in the appended part, and then just change a few instructions in original part to jmp to the new part? I searched over the Internet, but I haven't found an obvious solution (well, some propose writing code in NOP sections, but my code i longer than the longest of them).

Note that the PE is 64-bit, so the solution must work for this architecture.

2

Yes, you can add a new section to your PE file.

High-level instructions at Adding sections to PE Files and low-level instructions at Inject your code to a Portable Executable file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.