Resource Container (RCO)
Description
Resource Container Objet (RCO) contents are loaded by XMB modules (also known as .sprx plugins), see Plugin Interfaces and VSH
- Compression types availables:
- ZLIB
- RLZ
- Uncompressed
Contents
- RCO contents (See Multimedia Formats and Tools):
Text for all languages, textures, sounds (for cursor navigation, trophy unlocking, etc...) and models
RCO format | Embedded code | Text | Textures | Sounds | Models | Script |
---|---|---|---|---|---|---|
Generic | RCOXML | utf8, utf16, utf32 | gim, png, jpg, tif, gif, bmp | vag, unknown0x0 | gmo | PlayStation JavaScript |
PS3 specific | RCOXML | utf16 | gim, png, jpg | vag | n/a | n/a |
Versions
RCO Structure
The container structure can be represented as an XML (see RCOXML), with rcomage is posible to generate this XML when extracting, and for rebuilding the rco using the XML as a layout
http://endlessparadigm.com/forum/showthread.php?tid=231 (outdated)
Header
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x00 | 0x04 | magic | FRP | In PS3 is "FRP" (big endian). In PSP is "PRF" (little endian). Playstation Resource File | |
0x04 | 0x04 | version | 00 00 01 30 | named minFirmwareVer in Rcomage, see Discussion page | |
0x08 | 0x04 | unknown | 00 00 00 00 | Always seems to be 0x00000000 | |
0x0C | 0x04 | compress_header | 00 00 00 00 | *0x00=uncompressed *0x10=ZLIB *0x20=RLZ |
|
0x10 | 0x04 | info_table_offset | 00 00 00 A4 | usually 0xA4 | |
0x14 | 0x04 | vsmx_table_offset | |||
0x18 | 0x04 | text_table_offset | |||
0x1C | 0x04 | sound_table_offset | |||
0x20 | 0x04 | model_table_offset | |||
0x24 | 0x04 | image_table_offset | |||
0x28 | 0x04 | unknown | FF FF FF FF | Always seems to be 0xFFFFFFFF | unknown_table_offset ? |
0x2C | 0x04 | font_table_offset | |||
0x30 | 0x04 | object_table_offset | |||
0x34 | 0x04 | anim_table_offset |
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x38 | 0x04 | text_table_offset | |||
0x3C | 0x04 | text_table_length | |||
0x40 | 0x04 | label_table_offset | |||
0x44 | 0x04 | label_table_length | |||
0x48 | 0x04 | native_table_offset | |||
0x4C | 0x04 | native_table_length |
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x50 | 0x04 | text_pointer_table_offset | |||
0x54 | 0x04 | text_pointer_table_length | |||
0x58 | 0x04 | image_pointer_table_offset | |||
0x5C | 0x04 | image_pointer_table_length | |||
0x60 | 0x04 | model_pointer_table_offset | |||
0x64 | 0x04 | model_pointer_table_length | |||
0x68 | 0x04 | sound_pointer_table_offset | |||
0x6C | 0x04 | sound_pointer_table_length | |||
0x70 | 0x04 | object_pointer_table_offset | |||
0x74 | 0x04 | object_pointer_table_length | |||
0x78 | 0x04 | anim_pointer_table_offset | |||
0x7C | 0x04 | anim_pointer_table_length |
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x80 | 0x04 | image_data_section_offset | |||
0x84 | 0x04 | image_data_section_length | |||
0x88 | 0x04 | sound_data_section_offset | |||
0x8C | 0x04 | sound_data_section_length | |||
0x90 | 0x04 | model_data_section_offset | |||
0x94 | 0x04 | model_data_section_length | |||
0x98 | 0x04 | unknown | Always seems to be 0xFFFFFFFF | unknown_data_section_offset ? | |
0x9C | 0x04 | unknown | Always seems to be 0xFFFFFFFF | unknown_data_section_length ? | |
0xA0 | 0x04 | unknown | Always seems to be 0xFFFFFFFF |
info/main/xml table
This area works as an index of all the .rco contents, when the area is compressed there are 12 bytes at the beginning with info about this compression, after it starts the info composed by entries that follows a hierarchy of parent/children/brother, every entry defines an element with its attributes. All this info can be represented as an xml file (this is what rcomage names an RCOXML)
Compression methods
When the table is compressed at beginning there are 3 values related with the compression (otherway if the table is not compressed this 3 values doesnt exists)
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x00 | 0x04 | lenPacked | Packed size of all the table sections | ||
0x04 | 0x04 | lenUnpacked | Unpacked size of all the table sections | ||
0x08 | 0x04 | lenLongestText | length of the longest language's text data (unpacked) |
Info entry
Common area
Each entry starts with the entries, every entry has an area at beginning that is common, in it is specifyed the entry_type, the values that comes after this area are dependant of the entry_type
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x00 | 0x01 | hierarchy_depth | main table uses 0x01, may be used as a current entry depth value | ||
0x01 | 0x01 | entry_type | 0x1=MainTree 0x2=ScriptTree 0x3=TextTree 0x4=ImageTree 0x5=ModelTree 0x6=SoundTree 0x7=FontTree 0x8=ObjectTree 0x9=AnimTree |
||
0x02 | 0x02 | unknown | Always seems to be 0x0000 | ||
0x04 | 0x04 | entry_label_offset | Offset to the label (relative to the label table). 0xFFFFFFFF means the label doesn't exist for this entry | ||
0x08 | 0x04 | entry_header_size | sizeof(RCOEntry) = 0x28 [ only used for entries with extra info (ie not "main" entries) ] | ||
0x0C | 0x04 | entry_size | main tables (main/img etc) uses 0x28 here, or is this the length of current entry (not including subentries)? | ||
0x10 | 0x04 | children_number | |||
0x14 | 0x04 | next_entry_offset | next_brother_offset ? | ||
0x18 | 0x04 | previous_entry_offset | this is usually 0x0 however (does make writing RCOs easier though :P I guess Sony's tools do something similar...) | previous_brother_offset ? | |
0x1C | 0x04 | parent_offset | offset of this entry from parent table 0x20 | ||
0x20 | 0x04 | unknown | Always seems to be 0x00000000 | ||
0x24 | 0x04 | unknown | Always seems to be 0x00000000 |
After the area common for all entries it starts the info specific for each entry_type explained below
(0x1) MainTree
Main tree doesnt uses specific attributes, only uses the default ones explained above that indicates his position at top of the RCOXML Structure hierarchy and gives it a "label" name
(0x2) ScriptTree
This is named "ScriptTree" for simplification purposes, but is not actually a tree, only one VSMX file can be stored inside an RCO
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x00 | 0x04 | file_offset | VSMX file offset, relative to the start offset of the vsmx data table (always 0) | ||
0x04 | 0x04 | file_size | VSMX file length |
(0x3) TextTree
(0x4) ImageTree
The values marked in red are optional, the presence of the unknown specific for PS3 can be deduced based on the "rco version" in the rco header, only exists in PS3 RCO's (PSP doesnt uses it). See rcomage talk page. The presence of the other optional value file_uncompressed_size can be deduced by reading the entry itself
The file_compression feature adds a compression layer over the file format (pointless for image formats that are nativelly compressed like GIM or JPG)
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x00 | 0x02 | file_format | 0x0=PNG 0x1=JPEG 0x2=TIFF 0x3=GIF 0x4=BMP 0x5=GIM |
||
0x02 | 0x02 | file_compression | 0x0=NONE 0x1=ZLIB 0x2=RLZ |
||
0x04 | 0x04 | file_size | either compressed or uncompressed, this is the final size of the file stored inside the rco | ||
0x08 | 0x04 | file_offset | |||
0x0C | 0x04 | unknown | PS3 RCOs seem to have this extra value - probably something to do with planes/frames?? usually 0x1 | ||
0x10 | 0x04 | file_uncompressed_size | Doesn't exist if file_compression = NONE, for PSP is located 4 bytes before because the previous value doesn't exists |
(0x5) ModelTree
ModelTree uses the same values than ImageTree with a couple of differences, the table is repeated here for comparison purposes
The presence of the unknown (specific for PS3) is completlly speculative because never has been found a GMO file used on PS3 official firmware, is not even known if PS3 firmware has some function able to manage GMO files
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x00 | 0x02 | file_format | 0x0=GMO | ||
0x02 | 0x02 | file_compression | 0x0=NONE 0x1=ZLIB 0x2=RLZ |
||
0x04 | 0x04 | file_size | either compressed or uncompressed, this is the final size of the file stored inside the rco | ||
0x08 | 0x04 | file_offset | Offset of data relative to the beginning of the image data section | ||
0x0C | 0x04 | unknown | PS3 RCOs seem to have this extra value - probably something to do with planes/frames?? usually 0x1 | ||
0x10 | 0x04 | file_uncompressed_size | Doesn't exist if file_compression = NONE, for PSP is located 4 bytes before because the previous value doesn't exists |
(0x6) SoundTree
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x00 | 0x02 | file_format | 0x0=unknown 0x1=VAG |
||
0x02 | 0x02 | audio_channels | 0x1=MONO 0x2=STEREO |
||
0x04 | 0x04 | file_size | either one or two channels, this is the final size of the file stored inside the rco | ||
0x08 | 0x04 | file_offset | Offset of the sound data to the beginning of the sound data section | ||
0x0C | 0x04 | left_channel_size | This is the size of left channel file | ||
0x10 | 0x04 | left_channel_offset | Offset of left channel VAG to the beginning of the sound data section | ||
0x0C | 0x04 | right_channel_size | Only exists if audio_channels = STEREO | ||
0x10 | 0x04 | right_channel_offset | Only exists if audio_channels = STEREO |
(0x7) FontTree
Offset | Length | Name | Example | Notes | Speculation |
---|---|---|---|---|---|
0x00 | 0x02 | file_format | 0x1=? | ||
0x02 | 0x02 | file_compression | 0x0=NONE ? 0x1=ZLIB ? 0x2=RLZ ? |
||
0x04 | 0x04 | unknown | file_size ? | ||
0x08 | 0x04 | unknown | file_offset ? |
(0x8) ObjectTree
(0x9) AnimTree
|