Create an exe from an exe.

Hi everybody.
I have a question, how could i create an exe from my project ?
I'm opening the file like newarchive.open("archive.exe", ios::binary);
But now, how could i put commands inside?
Thanks
Binary modification is a tricky task. I disrecommend doing it unless you know exactly what you're doing. What exactly are you trying to do? It might be a better idea to store the source code somewhere so that your program can access it, modify it, and then call the compiler from the shell.

EDIT: I misunderstood ya. Sorry.

-Albatross
Last edited on
Do you mean duplicate the exe?
Well, what i want to do is similar to a winrar, to save 2 archives and then make ONE exe with the 2 exes inside. When we open the exe created before it should make again the two exes.
So, i could copy the different twos exes to the variables, but know i must make the new exe wich will contain the code of the, make and execution.


Edit: I have a new idea, but i think i would need to give the new .cpp a variable, from the first exe. Is this possible ?
Example

int number = 2;

fstream archive;

archive.open("new.cpp", ios::binary);
archive << "here i need to put NUMBER, but not the contain.";

Last edited on
You mean an SFX archive? You can take a look at how 7-Zip does it.
Yeah something like that, i have to make the builder (like program winrar), and then where im lost, is to make the file .rar (in this case .exe).
Topic archived. No new replies allowed.