forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Patch to unpack-pbp

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Archaemic



Joined: 18 Mar 2007
Posts: 38

PostPosted: Wed Mar 19, 2008 6:06 am    Post subject: Patch to unpack-pbp Reply with quote

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
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Wed Mar 19, 2008 9:27 am    Post subject: Re: Patch to unpack-pbp Reply with quote

Archaemic wrote:
Code:
+      if (fseek(infile, header.offset[loop0], SEEK_SET != 0)) {


That line doesn't look quite right...
Back to top
View user's profile Send private message
Archaemic



Joined: 18 Mar 2007
Posts: 38

PostPosted: Wed Mar 19, 2008 9:43 am    Post subject: Reply with quote

...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
View user's profile Send private message
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Wed Mar 19, 2008 11:26 pm    Post subject: Reply with quote

Yesterday i read this topic, and a few minutes ago I found this:
http://forum.console-tribe.com/psp-official-homebrew-scene-news/t-released-rspsar-dumper-v3-2-a-64033.html
Is it using your patch? In the readme file it's giving credit to a certain "Blaky"...
Back to top
View user's profile Send private message
Archaemic



Joined: 18 Mar 2007
Posts: 38

PostPosted: Thu Mar 20, 2008 4:17 am    Post subject: Reply with quote

No, that's for unarchiving the 3.93 PSAR, not for unpacking the 3.93 PBP into its constituents. Wholly different.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group