12/09/2007, 04:55 AM
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:
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)
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
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)