libPBP ver. 0.01

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Hexstr
Posts: 5
Joined: Tue May 23, 2006 5:07 am

libPBP ver. 0.01

Post by Hexstr »

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.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

thank you this is a great way to keep files organized
10011011 00101010 11010111 10001001 10111010
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

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?
ufoz
Posts: 86
Joined: Thu Nov 10, 2005 2:36 am
Location: Tokyo
Contact:

Post by ufoz »

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.
Blue
Posts: 5
Joined: Sat Feb 25, 2006 9:14 pm

Post by Blue »

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.
Hexstr
Posts: 5
Joined: Tue May 23, 2006 5:07 am

Post by Hexstr »

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.
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

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...
Post Reply