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 

libPBP ver. 0.01

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



Joined: 23 May 2006
Posts: 5

PostPosted: Sun May 28, 2006 9:54 pm    Post subject: libPBP ver. 0.01 Reply with quote

Alright I've been working on and off for about a year on this and I think it's finally time to let the people have it. It's not quite up to par with the quality I usually like to put out but it'll have to do.

This is a library for dealing with PBP files or as I call them archives (since they do contain other files). When I started this about a year ago there I don't believe there were any libraries to working with PBP files and I still haven't seen any to this day.

But this is not just a library that can create and modify PBP archives. I have created a format that I call Extended PBP because it extends the original PBP format without affecting it. As most of you know in the PBP header it lists the offsets of the files that it contains. If you increase each offset by say 100 you can use 100 bytes of space after the PBP header and before the first file. So the file becomes [PBP header][your added data][first file][second file...etc. Because programs are made to read the first file at the offset specified in the PBP header you can add any and as much data as you want into the file and the program will still recognise it as if there was no extra data.

I think that this could bring about some cool changes because you can store any data such as files, directories, images in the PBP file without hurting it. Self extracting executables can be created and programs that use bootstrapping to load themselves into memory could include the user-mode prx into the EBOOT.PBP file. Anyway I'm sure you get the picture and I bet your already comming up with ingenius things.

I have included this in the PSP Tools Package that I am working on and have uploaded it to the SourceForge.net CVS. I haven't had time to make use of autocont yet so there is no build yet and you will have to download it from the anonymous CVS. Sorry :(.

Now the BIG problem is that since I'm currently in Afghanistan I have to go back out to the field really soon and I won't be able to start on any updates for about 2 months or so. So I'm counting on you guys to fix bugs and what not until I get back.

the code can be found in the CVS on SourceForge.net at http://www.sf.net/projects/psp-tools

Anyway have fun and make some cool stuff.

Later biz.
_________________
Check out www.sf.net/projects/psp-tools
Back to top
View user's profile Send private message AIM Address
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Mon May 29, 2006 10:35 am    Post subject: Reply with quote

thank you this is a great way to keep files organized
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Mon May 29, 2006 2:42 pm    Post subject: Reply with quote

Nice!
I understand more about the PBP format just by reading your post, but one question I have is can we add more files to the PBP, and put the file/offets into the header?
Would the PSP still run it if it reads the file BLAH.PNG in the header, or would we have to sceIoLseek/sceIoRead manually to the offsets that are contained it our program?
Back to top
View user's profile Send private message
ufoz



Joined: 10 Nov 2005
Posts: 86
Location: Tokyo

PostPosted: Mon May 29, 2006 4:06 pm    Post subject: Reply with quote

With kxploited programs it could get tricky to read extra stuff from your own pbp, since you'd have to find the exploited version (iirc the one that is running is just an elf renamed to pbp??). Not impossible, but annoying enough :)

Still, nice.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Blue



Joined: 25 Feb 2006
Posts: 5

PostPosted: Mon May 29, 2006 11:54 pm    Post subject: Reply with quote

ufoz wrote:
With kxploited programs it could get tricky to read extra stuff from your own pbp, since you'd have to find the exploited version (iirc the one that is running is just an elf renamed to pbp??). Not impossible, but annoying enough :)

Still, nice.


You can request the path to the renamed elf file(default path), the only thing left to do is indeed, finding the other real pbp. The annoying part is that there are several ways the dirs can be named (hiding corrupted icons). But it is a nice lib, you can always supply a seperate pbp.
Back to top
View user's profile Send private message
Hexstr



Joined: 23 May 2006
Posts: 5

PostPosted: Tue May 30, 2006 8:06 pm    Post subject: Reply with quote

Gary13579: The PBP format contains 8 files. The files are located by offset in the PBP header. So the first file which will always be PARAM.SFO will always be located at the first offset specified by the header. The offsets are an array of integers. So to get the offset of the first file you would just do offset_array[0]. It gets a little more complicated when not all the files are included. But the PBP header is 40 bytes long and in regular PBP files the first offset would be 40. In an Extended PBP file if you add a file all the offsets are just increased by the size of the added file. For example if the added file was 100 bytes the first offset would become 140. So to answer your question, yes you could add a file BLAH.PNG and the PSP would still read the PBP file as if BLAH.PNG was never added.

I don't believe that it would be to much of a hassle to find the PBP file and I think it would make kxploit cleaner. I would write a tutorial on how to do it but I'm not at my laptop currently so it will have to wait until I get back.

Is anyone actually planning on using this library? Any questions or comments on how it's implemented?

Later biz.
_________________
Check out www.sf.net/projects/psp-tools
Back to top
View user's profile Send private message AIM Address
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Wed May 31, 2006 12:05 am    Post subject: Reply with quote

Okay, so you can't change the contents of the header (at least add other files to it).
I don't see how this could make kxploit cleaner though... the non-% folder still needs to be a raw ELF (DATA.PSP), I'm pretty sure if you add any headers or other files it won't load...
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