Endless Paradigm

Full Version: A peak at the PTF format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13
Just managed to have a look at the PTF format that Sony introduces with their release of 3.70.

Haven't had the time to look through everything, but I think I've got the basic file structure (it's not very difficult ;)).  It seems to contain a lot of RLZ compressed files (they all appear to actually be GIM images).

Anyways, on with the structure, for anyone interested :P

The real data starts at 0x100 - before that, well, it's just ASCII and null characters... >_>

At 0x100, there's the 0x20 byte PTF header - all it contains are pointers to the various sections of the file.  Currently, only 5 sections exist (thus 5 pointers).

Now, for each section, there's a 0x20 byte header, with 4 values, taking up 0xC bytes (the rest of the 0x20 bytes are just nulls).  [the first section obviously appears at 0x100+0x20 = 0x120]
0x00: Appears to be the number of the current section (ie, first section = 0x00, second section = 0x01, etc)
0x02: Number of entries in the current section
0x04: Offset to the first Entry header in the next section, relative to the absolute offset of the first Entry header of the current section
0x08: Absolute offset of the first entry in the current section

Now under each section, there's a number of entries.  Each entry has a 0x20 header, followed by the data, which is RLZ compressed.  The header has 4 values, taking up 0x10 bytes (again, the rest is just nulls).  [the first entry obviously appears at 0x100+0x20+0x20 = 0x140]
0x00: Icon ID
0x04: Image type - exactly the same as the image type flag for image resources in RCO files:
  • 0x00 = PNG
  • 0x01 = JPEG
  • 0x02 = TIFF
  • 0x03 = GIF
  • 0x04 = BMP
  • 0x05 = GIM
Note that only GIMs are ever used, and a BMP for the background.  The other file types don't appear in PTF files.  Unfortunately, only GIM transparency is supported.
0x06: Compression flag?  0x01 = RLZ compressed, 0x00 = uncompressed?
0x08: Size of the data (compressed)
0x0C: Size of the data (uncompressed)




Attached is a PTF to RCO converter.  Note that this does NOT generate flashable RCOs.  After conversion, you'll need to run the RCO through Resurssiklunssi to decompress it.  After that, you can view and extract the contents, but there's really little other use.
Have fun :P
UPDATE: do not use below file, use this instead
[attachment=639]


Alternatively, you may wish to download a hexed copy (with two messages replaced) of the program, which includes a (what seems to be) modified (probably SFO/PNGs replaced) version of Resurssiklunssi from QJ.
Or, if you to stick your own name in the program, the source file is included.  However, if you lack the knowledge on how to compile the program, you can hex the program yourself - the "By" line is at 0x2230 in the EXE, the "conversion complete" message is stored at 0x25D4.  Happy hexing! :)

(Note, you may want to hex other messages as well to make it seem less obvious)
kool :great:
so does this mean, if you have time wee might be seeing a PTF editor 1.0 ZiNgA?
but your probably busy at uni at the moment right?
cool,,,, new rcoeditor will come?
not RCO, PTFEditor :)
Hot dang!  Very nice finds dude!!
Quote:I've been messing around a bit with the official theme files released for firmware 3.70 and I managed to split them apart into their various sections. I still have NO clue what the sections are, but I know for sure that the file is not encrypted, the data can be edited without corrupting the theme, the file has to be ≤512KB in size, and it is copied in its entirety into a file in flash (0, 1, 2, 3; I don't know which).

You can pad on as much data as you want, random or otherwise, up to exactly 512KB. You can even replace bits of one theme with bits of another so long as the stuff you're replacing is bigger than the stuff you're copying over it and you null out the trailing data to the end of the section. For example, I copied the 'classy pink' icon over the 'cookies' icon and it showed up with the 'classy pink' icon in the theme selector.

There doesn't even seem to be a checksum on the data in the theme header...

I made a tool for splitting the files apart. There seem to be three different types of section; they all have the same first two bytes (0xD9, 0x6B) preceded by either 0x05, 0x06, or 0x07 and followed by a header that is different depending on the section type.

Hope this inspires people to figure these out even more  I've attached the two currently existing official themes for testing purposes.
source: http://forums.qj.net/f-psp-development-f...20841.html
well so a ptf editor means official flashless customization
it still flashes.  On the official playstation board 3.70 firmware thread i thought i read that on the phatty it will install to flash1 and on the slim it installs to flash0.  But all the themes will be stored in ms:\psp\themes\
The current theme you use will be installed to flash just like Schmilk says.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13
Reference URL's