Code: Select all
--- unpack-pbp.c        (revision 2351)
+++ unpack-pbp.c        (working copy)
@@ -136,6 +136,12 @@
       
       // Skip the file if empty
       if (!size) continue;
+
+      // Seek to the proper position in the file
+      if (fseek(infile, header.offset[loop0], SEEK_SET) != 0) {
+         printf("ERROR: Could not seek in the input file.\n");
+         return -1;
+      }
       
       // Open the output file
       outfile = fopen(filename[loop0], "wb");
E] Fixed, no thanks to me being stupid, and thanks to IWN being not stupid
