1 /* Written 1999 Jan 29 by Josh Cogliati
2 I grant this program to public domain.
10 void main(int argc, char *argv[]){
11 FILE * hogfile, * writefile;
12 int fp, len, fseekret=0;
17 printf("Usage: hogextract hogfile\n"
18 "extracts all the files in hogfile into the current directory\n"
22 hogfile = fopen(argv[1],"r");
23 stat(argv[1],&statbuf);
24 printf("%i\n",statbuf.st_size);
25 buf = (char *)malloc(3);
26 fread(buf,3,1,hogfile);
27 printf("Extracting from: %s\n",argv[1]);
29 while(ftell(hogfile)<statbuf.st_size){
30 fread(filename,13,1,hogfile);
31 fread(&len,sizeof(int),1,hogfile);
32 printf("Filename: %s \tLength: %i\n",filename,len);
33 buf = (char *)malloc(len);
35 printf("Unable to allocate memory\n");
37 fread(buf,len,1,hogfile);
38 writefile = fopen(filename,"w");
39 fwrite(buf, len, 1 , writefile);