I am working on a project that should encrypt PE files ( Portable
executable ), this require me to inject some code to existing PEs.
First, I have tried:
1.. to inject some code to the end of the '.text' segment of an existing
PE
2.. to set the entry point RVA to the address of the injected code
3.. at the end of the injected code I have set a jmp to the original
entrypoint
The problem:
Opening that file and browsing to the entrypoint address I can see the
injected code BUT when running the application I can see that the IP points
to the correct address ( Base + RVA ) but the injected code is not there (
just some gibberish ), I tried setting the following flags for the section:
'IMAGE_SCN_MEM_PRELOAD | IMAGE_SCN_CNT_CODE | IMAGE_SCN_CNT_INITIALIZED_DATA
', BUT still, No good, I get the same results.
1.. Any comments remarks or pointers will be appreciated.
2.. Any pointers to documentation concerning how the PE loader work will
be appreciated ( e.g. which sections are loaded when, . )
You are about to answer a thread that has been inactive for more than 6 months. If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.