Spawning a new exe after compile?

Started by
3 comments, last by Neosmyle 21 years, 7 months ago
I was wondering about the technique for "spawning" a new exe with a different file or something. An example - a "self-extracting zip file", that you can create with winzip, and it is an exe that will open the file that you hardcore into it. Understand what I''m saying? I''m not quite sure how yet, but I think this might have a use in some of my projects. Thanks.
Advertisement
Are you saying that you want to launch a program from within another program? To do that, use ShellExecute() or CreateProcess().

If you mean creating a new .exe file, try CopyFile(), CreateFile() or a whole bunch of other functions.

Is that what you mean?
An exe file is just like an other file, it has a header and a data section (the machine code) theres nothing speical about it, all youd have to do is attach the exe as a resource to the end of your self extracting prog then get the offset for the start of it, theres probly some win32 functions to do this, then just read it in and then write it back to disk seperatly...

CEO Platoon Studios
[email=esheppard@gmail.com]esheppard@gmail.com[/email]
Yes, I know about exe''s, they have header/data, but I''m wondering about how to create the exe with a file attached to it (self-extracting zip file type thing). I will probably have to debug decompile to figure it all out
To create an exe with a file attached to it, just literally do that. Open the exe file and write the data at the end.

You''ll have to store the data length somewhere (at the very end seems to be a good place), but that''s about it.

This topic is closed to new replies.

Advertisement