I am currently working on a packer and I need to copy raw data in the section containing the code (. text), is there any way to do this in VC++ ?
If it's impossible, could you recommend me some good C/C++ lib to edit PE files ?
I am currently working on a packer and I need to copy raw data in the section containing the code (. text), is there any way to do this in VC++ ?
If it's impossible, could you recommend me some good C/C++ lib to edit PE files ?
Instead of trying to extend the .text
section, adding a new executable section and injecting your code there might be a better solution. Then you put a jmp
to the address from which you want to divert the execution (which will overwrite some of the instructions there), start your code with the overwritten instructions and continue to whatever you wanted to do, then return to the original execution with another jump. Note that if the overwritten code also contains addresses/relocations, these should also be updated properly.