Talk:Resource Container (RCO): Difference between revisions
m (→ImageTree with 1 image: horizontal black lines not needed, areas are specifyed at left column, i will add color to the areas later to make it a bit more intuitive) |
|||
Line 399: | Line 399: | ||
! Areas !! Offset !! Length !! Example !! Name !! Notes | ! Areas !! Offset !! Length !! Example !! Name !! Notes | ||
|- | |- | ||
| rowspan=" | | rowspan="46" | Header | ||
|-{{cellcolors|#666666|#ffffff}} | |-{{cellcolors|#666666|#ffffff}} | ||
| 0x00 || 0x04 || FRP || '''magic''' || FRP in big endian | | 0x00 || 0x04 || FRP || '''magic''' || FRP in big endian | ||
Line 490: | Line 490: | ||
|- | |- | ||
| 0xA0 || 0x04 || FF FF FF FF || ''unknown'' || | | 0xA0 || 0x04 || FF FF FF FF || ''unknown'' || | ||
|- | |- | ||
| rowspan=" | | rowspan="46" | TOC | ||
|- | |- | ||
| 0xA4 || 0x01 || 01 || '''entry_type''' || 0x1=MainTree | | 0xA4 || 0x01 || 01 || '''entry_type''' || 0x1=MainTree | ||
Line 584: | Line 582: | ||
|- | |- | ||
| 0x128 || 0x04 || 00 00 00 01 || ''unknown'' || | | 0x128 || 0x04 || 00 00 00 01 || ''unknown'' || | ||
|- | |- | ||
| rowspan=" | | rowspan="3" | pointers | ||
|- | |- | ||
| 0x12C || 0x04 || 00 00 00 F4 || || | | 0x12C || 0x04 || 00 00 00 F4 || || | ||
|- | |- | ||
| 0x130 || 0x04 || 00 00 00 00 || || | | 0x130 || 0x04 || 00 00 00 00 || || | ||
|- | |- | ||
| rowspan=" | | rowspan="2" | texts | ||
|- | |- | ||
| 0x134 || 0x00 || || || text table is empty | | 0x134 || 0x00 || || || text table is empty | ||
|- | |- | ||
| rowspan=" | | rowspan="5" | labels | ||
|- | |- | ||
| 0x134 || 0x05 || 74 65 73 74 00 || || test (null terminated) | | 0x134 || 0x05 || 74 65 73 74 00 || || test (null terminated) | ||
Line 610: | Line 602: | ||
|- | |- | ||
| 0x147 || 0x01 || 00 || || padding (aligned to 4 bytes boundary) | | 0x147 || 0x01 || 00 || || padding (aligned to 4 bytes boundary) | ||
|- | |- | ||
| rowspan=" | | rowspan="2" | events | ||
|- | |- | ||
| 0x148 || 0x00 || || || events table is empty | | 0x148 || 0x00 || || || events table is empty | ||
|- | |- | ||
| | | rowspan="2" | images | ||
|- | |||
| 0x148 || 0x8 || 0x8888888888888888 || || image_test.gim | |||
|} | |} | ||
Revision as of 16:03, 11 September 2016
RCO versions
All RCO files contains a version number, the version increases with bigger firmwares but not for every firmware and is not directly associated with it. The same versioning method is used in PSP and PS3 RCO's
It seems all the RCO's of a specific firmware shares the same version (verifyed for firmware 4.76) and seems to be the version of the "rco set", or the version of the "rco tool" used to compile the whole "rco set". RCOmage v1.1.1 (latest stable) identifyes the version with a list of hardcoded values
Code Sample
After extracting the contents of the RCO with RCOmage, the version is stored for rebuilding purposes in the RCOXML descriptor file as an attribute with the name minFirmwareVer
If the version is unknown is stored as unknownId0x%x using unknownId to specify the fact that is unknown + the real hex value 0x%x
Example... sysconf_plugin.rco from PS3 firmware 2.00 with version 0x106
Code Sample
Hashreports
PS3 all versions
all OFW 1.00-4.75 hashes: https://www.mirrorcreator.com/files/7KCMQKWQ/RCO-hashreport.7z_links <--- please someone convert this in a "human readable wiki table"
PSP 6.61
- PSP 6.60 and 6.61 firmware contains 63 .rco files (same files for both firmwares). Two of them are specific for PSPgo model (bluetooth_plugin.rco, slide_plugin.rco)
- Only 10 of them are compresed with ZLIB (dd_helper.rco, dnas_plugin.rco, htmlviewer_plugin.rco, lftv_rmc_univer3in1.rco, lftv_rmc_univer3in1_jp.rco, lftv_rmc_univertuner.rco, lftv_rmc_univertuner_jp.rco, lftv_tuner_jp_jp.rco, lftv_tuner_us_en.rco, oneseg_plugin.rco). All the others are compressed with RLZ (and RLZ decompression is not supported by rcomage, is needed to use Resurssiklunssi v0.3 to rebuild them)
- Resurssiklunssi rebuilds the .rco files and allows for two rebuild modes:
- TRIANGLE or CROSS - only rebuilds
- The converted files will have minFirmwareVer="1.5" (the original value is lost in the conversion)
- SQUARE or CIRCLE - rebuilds and recompress in ZLIB
- The converted files will have minFirmwareVer="2.6" (the original value is lost in the conversion)
- TRIANGLE or CROSS - only rebuilds
Code Sample
- PSP 6.60 and 6.61 firmware. RCO hashes after resurssiklunssi rebuild (cross option)
Code Sample
- PSP firmware 1.00 contains only 21 .rco files (all them uses ZLIB, none of them uses RLZ)
Code Sample
Examples
This is a temporal section for tests using rcomage to create frankensteins .rco files smallest as posible that could serve as an explain of his structure. Will contain the source xml file used to create the rco, a big table with ALL the values of the structure, and a sample in hexview of the created rco. Eventually one (or a couple) of this tables will be moved to front page but by now this is a shared notepad and experimentation to see how to make that tables intuitive, pretty, and smallest posible, feel free to add other examples
Also, i think rcomage has several problems (no offense intended is a great tool everybody loves) in how the areas of the structure are divided, some names that can be improved, some definition of lengths of partially known or unknown values, etc... the examples are going to look pretty similar to the examples i wrote at the bottom of CXML Containers page (the concept of how it works is the same)--Sandungas (talk) 18:48, 10 September 2016 (UTC)
ImageTree with 1 image
This is a basic example of how the files are stored inside the container, similar method is used for all files (images, models, sounds, and fonts ?)
The .xml below is the RCOXML source file used to create the .rco. The file image_test.gim is a dummy of 8 bytes filed with 8888888888888888
Code Sample
When compiled
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00000000 46 52 50 00 00 00 01 30 00 00 00 00 00 00 00 00 FRP....0........ 00000010 00 00 00 A4 FF FF FF FF FF FF FF FF FF FF FF FF ...¤ÿÿÿÿÿÿÿÿÿÿÿÿ 00000020 FF FF FF FF 00 00 00 CC FF FF FF FF FF FF FF FF ÿÿÿÿ...Ìÿÿÿÿÿÿÿÿ 00000030 FF FF FF FF FF FF FF FF 00 00 01 34 00 00 00 00 ÿÿÿÿÿÿÿÿ...4.... 00000040 00 00 01 34 00 00 00 14 00 00 01 48 00 00 00 00 ...4.......H.... 00000050 FF FF FF FF 00 00 00 00 00 00 01 2C 00 00 00 08 ÿÿÿÿ.......,.... 00000060 FF FF FF FF 00 00 00 00 FF FF FF FF 00 00 00 00 ÿÿÿÿ....ÿÿÿÿ.... 00000070 FF FF FF FF 00 00 00 00 FF FF FF FF 00 00 00 00 ÿÿÿÿ....ÿÿÿÿ.... 00000080 00 00 01 48 00 00 00 08 FF FF FF FF 00 00 00 00 ...H....ÿÿÿÿ.... 00000090 FF FF FF FF 00 00 00 00 FF FF FF FF FF FF FF FF ÿÿÿÿ....ÿÿÿÿÿÿÿÿ 000000A0 FF FF FF FF 01 01 00 00 00 00 00 00 00 00 00 00 ÿÿÿÿ............ 000000B0 00 00 00 28 00 00 00 01 00 00 00 00 00 00 00 00 ...(............ 000000C0 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 ................ 000000D0 FF FF FF FF 00 00 00 00 00 00 00 28 00 00 00 01 ÿÿÿÿ.......(.... 000000E0 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 ...........(.... 000000F0 00 00 00 00 04 01 00 00 00 00 00 08 00 00 00 28 ...............( 00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000110 00 00 00 28 00 00 00 00 00 00 00 00 00 05 01 00 ...(............ 00000120 00 00 00 08 00 00 00 00 00 00 00 01 00 00 00 F4 ...............ô 00000130 00 00 00 00 74 65 73 74 00 00 00 00 69 6D 61 67 ....test....imag 00000140 65 5F 74 65 73 74 00 00 88 88 88 88 88 88 88 88 e_test..ˆˆˆˆˆˆˆˆ
Areas | Offset | Length | Example | Name | Notes |
---|---|---|---|---|---|
Header | |||||
0x00 | 0x04 | FRP | magic | FRP in big endian | |
0x04 | 0x04 | 00 00 01 30 | version | 0x130 = one of the firmwares for PS3 | |
0x08 | 0x04 | 00 00 00 00 | unknown | ||
0x0C | 0x04 | 00 00 00 00 | compress_header | 0x00 = uncompressed | |
0x10 | 0x04 | 00 00 00 A4 | toc_maintree_absolute_offset | MainTree at absolute offset 0xA4 | |
0x14 | 0x04 | FF FF FF FF | toc_scripttree_absolute_offset | ||
0x18 | 0x04 | FF FF FF FF | toc_languagetree_absolute_offset | ||
0x1C | 0x04 | FF FF FF FF | toc_soundtree_absolute_offset | ||
0x20 | 0x04 | FF FF FF FF | toc_modeltree_absolute_offset | ||
0x24 | 0x04 | 00 00 00 CC | toc_imagetree_absolute_offset | ImageTree at absolute offset 0xCC | |
0x28 | 0x04 | FF FF FF FF | toc_unknowntree_absolute_offset | ||
0x2C | 0x04 | FF FF FF FF | toc_fonttree_absolute_offset | ||
0x30 | 0x04 | FF FF FF FF | toc_objecttree_absolute_offset | ||
0x34 | 0x04 | FF FF FF FF | toc_animationtree_absolute_offset | ||
0x38 | 0x04 | 00 00 01 34 | strings_texts_absolute_offset | strings texts table at absolute offset 0x134 | |
0x3C | 0x04 | 00 00 00 00 | strings_texts_length | strings texts table is empty | |
0x40 | 0x04 | 00 00 01 34 | strings_labels_absolute_offset | strings labels table at absolute offset 0x134 | |
0x44 | 0x04 | 00 00 00 14 | strings_labels_length | strings labels size 0x14 | |
0x48 | 0x04 | 00 00 01 48 | strings_events_absolute_offset | strings events table at absolute offset 0x148 | |
0x4C | 0x04 | 00 00 00 00 | strings_events_length | strings events table is empty | |
0x50 | 0x04 | FF FF FF FF | text_pointer_table_offset | ||
0x54 | 0x04 | 00 00 00 00 | text_pointer_table_length | ||
0x58 | 0x04 | 00 00 01 2C | image_pointer_table_offset | ||
0x5C | 0x04 | 00 00 00 00 | image_pointer_table_length | ||
0x60 | 0x04 | FF FF FF FF | model_pointer_table_offset | ||
0x64 | 0x04 | 00 00 00 00 | model_pointer_table_length | ||
0x68 | 0x04 | FF FF FF FF | sound_pointer_table_offset | ||
0x6C | 0x04 | 00 00 00 00 | sound_pointer_table_length | ||
0x70 | 0x04 | FF FF FF FF | object_pointer_table_offset | ||
0x74 | 0x04 | 00 00 00 00 | object_pointer_table_length | ||
0x78 | 0x04 | FF FF FF FF | anim_pointer_table_offset | ||
0x7C | 0x04 | 00 00 00 00 | anim_pointer_table_length | ||
0x80 | 0x04 | 00 00 01 48 | image_data_section_offset | ||
0x84 | 0x04 | 00 00 00 08 | image_data_section_length | ||
0x88 | 0x04 | FF FF FF FF | sound_data_section_offset | ||
0x8C | 0x04 | 00 00 00 00 | sound_data_section_length | ||
0x90 | 0x04 | FF FF FF FF | model_data_section_offset | ||
0x94 | 0x04 | 00 00 00 00 | model_data_section_length | ||
0x98 | 0x04 | FF FF FF FF | unknown | ||
0x9C | 0x04 | FF FF FF FF | unknown | ||
0xA0 | 0x04 | FF FF FF FF | unknown | ||
TOC | |||||
0xA4 | 0x01 | 01 | entry_type | 0x1=MainTree | |
0xA5 | 0x01 | 01 | hierarchy_depth | ||
0xA6 | 0x02 | 00 00 | unknown | ||
0xA8 | 0x04 | 00 00 00 00 | entry_label_offset | test | |
0xAC | 0x04 | 00 00 00 00 | entry_header_size | ||
0xB0 | 0x04 | 00 00 00 28 | entry_size | ||
0xB4 | 0x04 | 00 00 00 01 | children_number | ||
0xB8 | 0x04 | 00 00 00 00 | next_entry_offset | ||
0xBC | 0x04 | 00 00 00 00 | previous_entry_offset | ||
0xC0 | 0x04 | 00 00 00 00 | parent_offset | ||
0xC4 | 0x04 | 00 00 00 00 | unknown | ||
0xC8 | 0x04 | 00 00 00 00 | unknown | ||
0xCC | 0x01 | 04 | entry_type | 0x4=ImageTree | |
0xCD | 0x01 | 00 | hierarchy_depth | ||
0xCE | 0x02 | 00 00 | unknown | ||
0xD0 | 0x04 | FF FF FF FF | entry_label_offset | no label | |
0xD4 | 0x04 | 00 00 00 00 | entry_header_size | ||
0xD8 | 0x04 | 00 00 00 28 | entry_size | ||
0xDC | 0x04 | 00 00 00 01 | children_number | ||
0xE0 | 0x04 | 00 00 00 00 | next_entry_offset | ||
0xE4 | 0x04 | 00 00 00 00 | previous_entry_offset | ||
0xE8 | 0x04 | 00 00 00 28 | parent_offset | ||
0xEC | 0x04 | 00 00 00 00 | unknown | ||
0xF0 | 0x04 | 00 00 00 00 | unknown | ||
0xF4 | 0x01 | 04 | entry_type | 0x4=ImageTree | |
0xF5 | 0x01 | 01 | hierarchy_depth | ||
0xF6 | 0x02 | 00 00 | unknown | ||
0xF8 | 0x04 | 00 00 00 08 | entry_label_offset | image_test | |
0xFC | 0x04 | 00 00 00 28 | entry_header_size | ||
0x100 | 0x04 | 00 00 00 00 | entry_size | ||
0x104 | 0x04 | 00 00 00 00 | children_number | ||
0x108 | 0x04 | 00 00 00 00 | next_entry_offset | ||
0x10C | 0x04 | 00 00 00 00 | previous_entry_offset | ||
0x110 | 0x04 | 00 00 00 28 | parent_offset | ||
0x114 | 0x04 | 00 00 00 00 | unknown | ||
0x118 | 0x04 | 00 00 00 00 | unknown | ||
0x11C | 0x02 | 00 05 | file_format | 0x5=GIM | |
0x11E | 0x01 | 01 | unknown | ||
0x11F | 0x01 | 00 | file_compression | 0x0=NONE | |
0x120 | 0x04 | 00 00 00 08 | file_size | ||
0x124 | 0x04 | 00 00 00 00 | file_offset | ||
0x128 | 0x04 | 00 00 00 01 | unknown | ||
pointers | |||||
0x12C | 0x04 | 00 00 00 F4 | |||
0x130 | 0x04 | 00 00 00 00 | |||
texts | |||||
0x134 | 0x00 | text table is empty | |||
labels | |||||
0x134 | 0x05 | 74 65 73 74 00 | test (null terminated) | ||
0x139 | 0x03 | 00 00 00 | padding (aligned to 4 bytes boundary) | ||
0x13C | 0x0B | 69 6D 61 67 65 5F 74 65 73 74 00 | image_test (null terminated) | ||
0x147 | 0x01 | 00 | padding (aligned to 4 bytes boundary) | ||
events | |||||
0x148 | 0x00 | events table is empty | |||
images | |||||
0x148 | 0x8 | 0x8888888888888888 | image_test.gim |
ImageTree with 2 images
This example is intended to replace the previous one (but by now i dont want to delete the previous one). It can help to see how the offsets are cummulated and the optional paddings to align to boundary The .xml below is the RCOXML source file used to create the .rco. The file image2_test.gim is a dummy of 2 bytes filed with 2222 and the file image3_test.gim is a dummy of 3 bytes filed with 333333
Code Sample
When compiled
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00000000 46 52 50 00 00 00 01 30 00 00 00 00 00 00 00 00 FRP....0........ 00000010 00 00 00 A4 FF FF FF FF FF FF FF FF FF FF FF FF ...¤ÿÿÿÿÿÿÿÿÿÿÿÿ 00000020 FF FF FF FF 00 00 00 CC FF FF FF FF FF FF FF FF ÿÿÿÿ...Ìÿÿÿÿÿÿÿÿ 00000030 FF FF FF FF FF FF FF FF 00 00 01 70 00 00 00 00 ÿÿÿÿÿÿÿÿ...p.... 00000040 00 00 01 70 00 00 00 20 00 00 01 90 00 00 00 00 ...p... ........ 00000050 FF FF FF FF 00 00 00 00 00 00 01 68 00 00 00 08 ÿÿÿÿ.......h.... 00000060 FF FF FF FF 00 00 00 00 FF FF FF FF 00 00 00 00 ÿÿÿÿ....ÿÿÿÿ.... 00000070 FF FF FF FF 00 00 00 00 FF FF FF FF 00 00 00 00 ÿÿÿÿ....ÿÿÿÿ.... 00000080 00 00 01 90 00 00 00 14 FF FF FF FF 00 00 00 00 ........ÿÿÿÿ.... 00000090 FF FF FF FF 00 00 00 00 FF FF FF FF FF FF FF FF ÿÿÿÿ....ÿÿÿÿÿÿÿÿ 000000A0 FF FF FF FF 01 01 00 00 00 00 00 00 00 00 00 00 ÿÿÿÿ............ 000000B0 00 00 00 28 00 00 00 01 00 00 00 00 00 00 00 00 ...(............ 000000C0 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 ................ 000000D0 FF FF FF FF 00 00 00 00 00 00 00 28 00 00 00 02 ÿÿÿÿ.......(.... 000000E0 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 ...........(.... 000000F0 00 00 00 00 04 01 00 00 00 00 00 08 00 00 00 28 ...............( 00000100 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 ...........8.... 00000110 00 00 00 28 00 00 00 00 00 00 00 00 00 05 01 00 ...(............ 00000120 00 00 00 02 00 00 00 00 00 00 00 01 04 01 00 00 ................ 00000130 00 00 00 14 00 00 00 28 00 00 00 00 00 00 00 00 .......(........ 00000140 00 00 00 00 00 00 00 38 00 00 00 60 00 00 00 00 .......8...`.... 00000150 00 00 00 00 00 05 00 01 00 00 00 0E 00 00 00 04 ................ 00000160 00 00 00 01 00 00 00 03 00 00 00 F4 00 00 01 2C ...........ô..., 00000170 74 65 73 74 00 00 00 00 69 6D 61 67 65 32 5F 74 test....image2_t 00000180 65 73 74 00 69 6D 61 67 65 33 5F 74 65 73 74 00 est.image3_test. 00000190 22 22 00 00 78 DA 01 03 00 FC FF 33 33 33 01 35 ""..xÚ...üÿ333.5 000001A0 00 9A 00 00 .š..
ObjectTree with 1 page and 1 plane
This is a basic example of how objecttree and animationtree (not files) stores his values inside the container. It can help to understand all the values related with the hierarchy relationship between parents/childrens/brothers, etc...
Code Sample