Basically I'm combining two binaries using the "cat" command on Linux. And I want to be able to separate them again using C this is the code I got so far
int main(int argc, char *argv[]) {
// Getting this file
FILE *localFile = fopen(argv[0], "rb");
// Naming a new file to save our carved binary
FILE *newFile = fopen(argv[1], "wb+");
// Moving the cursor to the offset: 19672 which is the size of this file
fseek(localFile, 19672, SEEK_SET);
// Copying to the new file
char ch;
while ( ( ch = fgetc(localFile) ) != EOF ) {
fputc(ch, newFile);
}
}