Oppure

Loading
06/10/07 14:40
Ciao raga sto cercando di creare un programma che unisce due file eseguibili.
Questo è il source
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
long size1;
char *buff1;
long size2;
char *buff2;
ifstream in1("1.exe",ios::binary);
ifstream in2("2.exe",ios::binary);
ofstream out("3.exe",ios::binary);
in1.seekg(0,ifstream::end);
size1=in1.tellg();
in1.seekg(0);
buff1=new char[size1];
in1.read(buff1,size1);
out.write(buff1,size1);
in1.close();
in2.seekg(0,ifstream::end);
size2=in2.tellg();
in2.seekg(0);
buff2=new char[size2];
in2.read(buff2,size2);
out.write(buff2,size2);
in2.close();
out.close();
delete[] buff1;
delete[] buff2;
}
Quando lo eseguo mi crea un terzo file.
Ma quando eseguo il file creato mi esegue solo il primo dei file che ho unito.
Qualcuno può aiutarmi?
Grazie in anticipo.
06/10/07 14:51
netarrow
pierotofy.it/pages/sorgenti/browse/15199/

vedi se può esserti utile
Ultima modifica effettuata da netarrow 06/10/07 14:51
aaa
06/10/07 15:39
Mi è stato utilissimo.
Grazie 1000 e ciao!