#include #include unsigned char st0[4096], st1[4096]; int main (int argc, char **argv) { FILE *filr, *filw; int z, zz, k, l, lf, plc, cnt, f0, f1, leng, overwriteall; unsigned char ch, och; char filnam[260]; if (argc != 2) { puts("qmov2jpg [.MOV filename]\t\t\t\tby Ken Silverman"); return(-1); } filr = fopen(argv[1],"rb"); if (!filr) { puts("error opening file"); return(-1); } fseek(filr,0,SEEK_END); lf = ftell(filr); fseek(filr,0,SEEK_SET); ch = 0; plc = 0; f0 = 0; cnt = 0; overwriteall = 0; while (plc < lf) { k = lf-plc; if (k > sizeof(st0)) k = sizeof(st0); fread(st0,k,1,filr); for(z=0;z= 'a') && (och <= 'z')) och -= 32; } while ((och != 'Y') && (och != 'N') && (och != 'A') && (och != 27)); if (och == 27) { fclose(filr); return(-1); } printf("%c\n\t",och); if (och == 'A') { overwriteall = 1; och = 'Y'; } fclose(filw); } else och = 'Y'; } else och = 'Y'; if (och == 'Y') { printf("\t%s\n",filnam); filw = fopen(filnam,"wb"); if (filw) { for(zz=0;zz sizeof(st1)) l = sizeof(st1); fread(st1,l,1,filr); fwrite(st1,l,1,filw); } fclose(filw); } } else printf("\t---\n"); fseek(filr,plc+k,SEEK_SET); cnt++; } } } plc += k; } fclose(filr); return(0); }