| View previous topic :: View next topic |
| Author |
Message |
Archaemic
Joined: 18 Mar 2007 Posts: 38
|
Posted: Wed Mar 19, 2008 6:06 am Post subject: Patch to unpack-pbp |
|
|
With the release of the second version of 3.93 (that I've found--the PSAR is slightly bigger than the version that was up earlier), the beginning of the PBP was padded such that the offset listed for the beginning (the PARAM.SFO) wasn't directly after the header. This was not being read properly by unpack-pbp. Here's a patch so that it is:
| Code: | --- 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");
|
(That's actually executed for every file, which is superfluous, but I really shouldn't be working on this right now, so I'll leave it as an exercise for the reader to figure out how to get it to only seek on the first run of the loop)
E] Fixed, no thanks to me being stupid, and thanks to IWN being not stupid
Last edited by Archaemic on Wed Mar 19, 2008 9:59 am; edited 2 times in total |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Wed Mar 19, 2008 9:27 am Post subject: Re: Patch to unpack-pbp |
|
|
| Archaemic wrote: | | Code: | | + if (fseek(infile, header.offset[loop0], SEEK_SET != 0)) { |
|
That line doesn't look quite right... |
|
| Back to top |
|
 |
Archaemic
Joined: 18 Mar 2007 Posts: 38
|
Posted: Wed Mar 19, 2008 9:43 am Post subject: |
|
|
...wow, how did I not notice that (and how did I write that in the first place)? Thank you. I must be dead today. Stupid midterms wreaking havoc on my brain!
E] Oh, wait, still dead. Let me see if it's not broken...it was working before, oddly.
E2] Yeah, it works. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
|
| Back to top |
|
 |
Archaemic
Joined: 18 Mar 2007 Posts: 38
|
Posted: Thu Mar 20, 2008 4:17 am Post subject: |
|
|
| No, that's for unarchiving the 3.93 PSAR, not for unpacking the 3.93 PBP into its constituents. Wholly different. |
|
| Back to top |
|
 |
|