mirror of
https://github.com/reactos/reactos.git
synced 2024-11-07 07:00:19 +00:00
52 lines
731 B
C
52 lines
731 B
C
|
#include <stdio.h>
|
||
|
|
||
|
FILE *in;
|
||
|
FILE *in2;
|
||
|
FILE *out;
|
||
|
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
unsigned char ch;
|
||
|
|
||
|
if (argc < 4)
|
||
|
{
|
||
|
printf("usage: stubit infile1.bin infile2.sys outfile.bin\n");
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
if ((in = fopen(argv[1], "rb")) == NULL)
|
||
|
{
|
||
|
printf("Couldn't open data file.\n");
|
||
|
return -1;
|
||
|
}
|
||
|
if ((in2 = fopen(argv[2], "rb")) == NULL)
|
||
|
{
|
||
|
printf("Couldn't open data file.\n");
|
||
|
return -1;
|
||
|
}
|
||
|
if ((out = fopen(argv[3], "wb")) == NULL)
|
||
|
{
|
||
|
printf("Couldn't open output file.\n");
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
ch = fgetc(in);
|
||
|
while (!feof(in))
|
||
|
{
|
||
|
fputc(ch, out);
|
||
|
ch = fgetc(in);
|
||
|
}
|
||
|
|
||
|
ch = fgetc(in2);
|
||
|
while (!feof(in2))
|
||
|
{
|
||
|
fputc(ch, out);
|
||
|
ch = fgetc(in2);
|
||
|
}
|
||
|
|
||
|
fclose(in);
|
||
|
fclose(in2);
|
||
|
fclose(out);
|
||
|
|
||
|
return 0;
|
||
|
}
|