#include #include #include main(int argc, char *argv[]) { FILE *f, *g; int a, b=0, c, len=0; unsigned char buf[8192]; if(argc < 1) { printf("Usage: %s file\n", **argv); exit(1); } if(!(f=fopen(argv[1], "r"))) { perror(argv[1]); exit(1); } if(!(g=fopen("enemies", "a"))) { perror("enemies"); exit(1); } for(len=0;len < 1048576;len += 512) { fread(buf, 512, 1, f); for(a=0;a<492;a++) { for(c=a;c 1000000) exit(0); fseek(f, len+72, SEEK_SET); while(fread(buf, 136, 1, f)) { if(!*buf || *buf == '_') break; fwrite(buf, 136, 1, g); printf("%-8.8s ZENNY EXP HP AP PWR DEF AGL INT STEAL RATE WIN RATE\n", buf); for(b=8;b<136;b+=2) printf("%-5d ", (buf[b+1]*256)+buf[b]); printf("\n\n"); } }