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

int main(int argc, char *argv[])
{
	FILE *f = fopen(argv[2], "r");
	FILE *o = fopen(argv[3], "w");
	unsigned char buf[256];

	if (!f || !o) exit(1);

	fprintf(o, "static unsigned char %s[] = {\n", argv[1]);

	while (!feof(f)) {
		int n = fread(buf, 1, 16, f);
		int i;
		for (i = 0; i < n; i++) {
			fprintf(o, "0x%02x,", buf[i]);
		}
		fprintf(o, "\n");
	}
	fprintf(o, "};\n");
	return 0;
}
