Skip to main content
gamedev.net
🔒 Locked

Loading EXE Files

Started by FrancoisSoft Aug 7, 2003 at 7:59 AM 1 replies 300+ views
Original Post
FrancoisSoft
FrancoisSoft
Ok, here''s the scenario. I''m trying to load and archive of EXE files from a single file. I don''t want to extract every single one and execute it as a separate file. Instead I loaded the data of each EXE file into a buffer. Is there anyway to execute the buffer or can I use a thread to execute that code after I read the EXE file''s header. What should I do?
Ruudje
Ruudje
I doubt there is any other way but to extract the file to the harddisk first... you could delete it afterwards again though. (thats how programs like winzip do it)
klems
klems
Technically, you could load code to execute like this:
void (*func)();
char *buffer;
// Load code into buffer
func = buffer;
func();

I wouldn''t recommend it, though.


"For crying out loud, she has fishes coming out of her head on either side. How can you find this hot?!"
"If anyone sees a suspicious, camouflaged factory being carried across the desert, they should report it immediately."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.