Page 1 of 1

The 3rd Birthday (*.pkg)

Posted: Thu Dec 23, 2010 6:40 pm
by The Chief
Hi guys i was checking this cool game the other day but i found that all
the files are in a single .pkg file i test a script from aluigi but dont work
this is a PSP game, if you open the big file with Hex you will find this:

Image

But besides that i dont know how to open that file =/

So any one want to take a look please ?

Thanks in advance. :wink:

Edit: My Apologies i didnt upload the sample beause its a 1.3 GB file =/ , i will see
if can upload later.

Re: The 3rd Birthday (*.pkg)

Posted: Fri Dec 24, 2010 1:09 pm
by Forte
The pkg doesn't seem to be compressed itself and just a container format, however I don't know how to tell where a file starts and ends. The fsd file has most likely something to do with it.
I've attached the first 7000h bytes of the pkg file (the png) and the fsd file.

Re: The 3rd Birthday (*.pkg)

Posted: Fri Dec 24, 2010 3:48 pm
by youngmark
Merry Christmas!
*.pkg file is the same format used in psp Evangelion : Jo.
Did you try Noesis?
http://oasis.xentax.com/index.php?content=downloads

Wish you the best for the holiday seasons!

Re: The 3rd Birthday (*.pkg)

Posted: Fri Dec 24, 2010 5:26 pm
by Forte
Although the file extension is the same, the format doesn't seem to be. At least Noesis says that "the file could not be previewed".
Anyway, the pkg file is divided into segments of size 0x800 and the fsd refers to the files not in actual addresses, but in segment numbers.
E.g. there's a PNG file at address 0x7000, in the fsd, that's 0x0E (0x7000/0x800 = 0xE)

The problem now is that there is no file list and you can't easily figure out the file extension of the files.

I've written a simple extractor which will basically separate the pkg into different files. Make sure the pkg and fsd files are in the same folder as the contents of the rar and start extract.bat to do the job.
The program will use the first four bytes of each file to guess the format, if you want it to recognize more formats, add them to the fileformats.ini (there's examples for png and psmf). Unknown files end up with ".unk"

Maybe there's a better solution for this, but that's all I came up with :/

Re: The 3rd Birthday (*.pkg)

Posted: Fri Dec 24, 2010 5:54 pm
by chrrox
if someone decrypts the eboot on their psp the file table should be in there with names.

Re: The 3rd Birthday (*.pkg)

Posted: Sat Dec 25, 2010 12:59 am
by Aerow
chrrox wrote:if someone decrypts the eboot on their psp the file table should be in there with names.
The eboot is already decrypted.

Re: The 3rd Birthday (*.pkg)

Posted: Sat Dec 25, 2010 1:34 am
by chrrox
then it needs to be decompressed. there are no strings that i can see so its still compressed.

Re: The 3rd Birthday (*.pkg)

Posted: Sat Dec 25, 2010 2:14 am
by Forte
Without going into any detail, whether the eboot is encrypted or not depends on the *ahem* "version" you're using.
In any case, the decrypted eboot does contain many strings, but none of them seem to be related to the file table belonging to the pkg/fsd.

Re: The 3rd Birthday (*.pkg)

Posted: Sat Dec 25, 2010 2:37 am
by Vash
it's normal in PSP games not to have the filenames...don't ask me why :oops:

The only thing you could do is keep investigating the headers and discover as much filetypes you can, maybe dividing them by folders will be easier to browse

Re: The 3rd Birthday (*.pkg)

Posted: Mon Dec 27, 2010 1:16 am
by kenshinjeff2
It seems that the rest of the files are encrypted. May I know how much of the fsd file was used to break the pkg file into smaller files? Also, why are the total filesizes different after extraction?

Re: The 3rd Birthday (*.pkg)

Posted: Mon Dec 27, 2010 8:47 am
by mariokart64n
3rd birthday uses a new encryption key, but can be decrypted with this tool
http://www.psp-hacks.com/file/1931

as for file listings, its true there doesnt appear to be any in the ELF/EBOOT

the game runs on the PSP Emulator decrypted, and I tried sniffing for file names.. no luck :\

Re: The 3rd Birthday (*.pkg)

Posted: Mon Dec 27, 2010 9:56 pm
by Forte
kenshinjeff2 wrote:It seems that the rest of the files are encrypted. May I know how much of the fsd file was used to break the pkg file into smaller files? Also, why are the total filesizes different after extraction?
The file table starts at 0x72C in the fsd, I have no idea what the data before it is.
Each file occupies 8 bytes in the table; the first 4 byte word stores the segment number (lower 20 bits) while the upper 12 bits are for something else. The word after that is always 1.

The total filesize is different because I forgot the last file. I'm not really motivated enough to fix it/continue since, well, there's no filenames and the interesting bits and pieces seem to be compressed files anyway.