5 int main(
int argc,
char ** argv) {
7 uint32_t v, c, checksum = 0;
11 fprintf(
stderr,
"Usage: %s <file>\n", argv[0]);
15 f = fopen(argv[1],
"r+");
18 perror(
"Failed opening input file");
22 for (i = 0; i < 7; i++) {
24 v >>= 8; c = fgetc(f); c <<= 24; v |= c;
25 v >>= 8; c = fgetc(f); c <<= 24; v |= c;
26 v >>= 8; c = fgetc(f); c <<= 24; v |= c;
27 v >>= 8; c = fgetc(f); c <<= 24; v |= c;
36 fputc(v & 0xff, f); v >>= 8;
37 fputc(v & 0xff, f); v >>= 8;
38 fputc(v & 0xff, f); v >>= 8;
39 fputc(v & 0xff, f); v >>= 8;