Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

executing code

Name: Anonymous 2011-03-29 9:21

i remember this topic coming up before, about executing binary code from within your code

let's say, I have some PE formatted executable, how would I execute it from within my program?

Name: Anonymous 2011-03-29 10:55

>>4
If there's no requirement on what the PE file format is, just make it a DLL (flag set in PE header) and make sure there are relocations (so it can be loaded at any address), then merely do a LoadLibraryA or LoadLibraryW to load the code. If you want to do it more "stealthily", you could map the pages manually into memory, resolve imports and perform relocations (among other things the PE loader does), but I'm not going to explain how to do all that here, learn the OS' internals yourself, it's too much to explain in a post.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List