
#include <stdio.h>
#include <stdlib.h>

FILE *img = 0, *entry = 0;
int cnt;
char buffer[2500];

int main() {

	if ((img = fopen("a.img", "r+b")) == NULL) {
		printf("\n Error opening a.img file");
		return 0xFF;
	}

	if ((entry = fopen("entry.com", "r+b")) == NULL) {
		printf("\n Error opening entry.com file");
		return 0xFF;
	}

	cnt = fread(buffer, 1, 2500, entry);

	fseek(img, 0x21400, SEEK_SET);
	fwrite(buffer, cnt, 1, img);

	fclose(img);
	fclose(entry);

	return 0;
}

