Dec 31, 2013 at 5:58pm UTC
I was trying to append two binary file specially EXE
so I coded this
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include<iostream>
using namespace std;
char first, last;
ofstream out(first, ios::out | ios::app | ios::binary);
ifstream in(last, ios::in | ios::binary);
This Code Append file successfully but when I Execute the appended Exe, only the first EXE will execute can anyone explain why and how to fix it so that successively both of exe will execute .
Last edited on
Dec 31, 2013 at 6:02pm UTC
Dec 31, 2013 at 6:00pm UTC
The way the file is
read by the system makes a difference too...
What exactly is it you are trying to do with your two executables?
Dec 31, 2013 at 6:03pm UTC
I only want to run both EXE successively.
Dec 31, 2013 at 6:23pm UTC
It doesn't work that way, unless you have written first EXE yourself, so you know the offset and it contains special code to extract and execute the second EXE. This tehnique is used by self-extracting archivers and some installers.
Are you trying to write a virus os something ?
Dec 31, 2013 at 6:31pm UTC
Nope I'm not writing a virus or something it is just my curiosity.
maybe if i delete 4 b-5 bytes from first exe than it will work
Maybe but let me test
Thanks @modoran and Duoas for your support