Editing Qt Resource Container (QRC)

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
== Description ==
location: /dev_flash/vsh/resource/qgl
QRC files ('''Q'''t '''R'''esources '''C'''ontainer) are located inside a QGL folder ('''Q'''t '''G'''raphics '''L'''ibrary) in path: '''dev_flash/vsh/resource/qgl''' with names: [[canyon.qrc]], [[earth.qrc]], [[icons.qrc]], [[icontex.qrc]], [[lines.qrc]], [[raf.qrc]], [[rhm.qrc]], and [[store.qrc]]. The contents of QRC files are compatible/generated with/by: [http://en.wikipedia.org/wiki/Qt_%28framework%29 Qt framework] and [http://en.wikipedia.org/wiki/OpenGL OpenGL]


The internal structure of QRC files can be clasifyed as one of the variants of a group of containers named: [[CXML Containers]]
== General format ==
QGL ('''Q'''t '''G'''raphics '''L'''ibrary) based in [http://en.wikipedia.org/wiki/Qt_%28framework%29 Qt framework] and [http://en.wikipedia.org/wiki/OpenGL OpenGL]


*QRC related firmware modules in '''dev_flashvsh/modules/''':
=== QRCC ===
**qglbase.sprx <--- generic
QRCC ('''Q'''t '''R'''esources '''C'''ontainer '''C'''ompressed)
**qgl_gaia_app.sprx <--- earth animation inside music player
 
**qgl_canyon_app.sprx <--- abstract animation inside music player
QRC file ZLIB Compressed level 9.
**custom_render_plugin.sprx
 
*Example from 3.55 rhm.qrc:
'''Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F'''
'''00000000'''  <span style="background:#ff6666;">51 52 43 43</span> <span style="background:#6666ff;">00 00 28 00</span> <span style="background:#00ff00;">78 DA</span>                      QRCC..(.xÚ
 
{| class="wikitable sortable"
|-
| style="background-color:#515243; color:#FFFFFF;" |'''Name'''
| style="background-color:#515243; color:#FFFFFF;" |'''Offset'''
| style="background-color:#515243; color:#FFFFFF;" |'''Size'''
| style="background-color:#515243; color:#FFFFFF;" |'''Example'''
| style="background-color:#515243; color:#FFFFFF;" |'''Remark'''
|-
| <span style="background:#ff6666;">Magic header || 0x00 || 0x04 || 51 52 43 43 || 'QRCC'
|-
| <span style="background:#6666ff;">File size decompressed (QRCF) || 0x04 || 0x04 || 00 00 28 00 ||
|-
| <span style="background:#00FF00;">ZLIB header || 0x08 || 0x02 || 78 DA || default/max level 9
|-
|}
 
=== QRCF ===
QRCF ('''Q'''t '''R'''esources '''C'''ontainer '''F'''lat?)
 
QRC "container" with an structure similar than themes .p3t
 
====Main Header====
*Example from fw 3.55 rhm.qrc:
'''Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F'''
'''00000000'''  <span style="background:#ff6666;">51 52 43 46  00 00 01 10  00 00 00 40  00 00 02 CC</span>  QRCF.......@..%|
'''00000010''' <span style="background:#66ff66;">00 00 03 10  00 00 01 2B</span>  <span style="background:#ffff66;">00 00 04 40  00 00 00 1B</span>  ..%À......9Ð....
'''00000020'''  <span style="background:#ffff66;">00 00 04 60</span>  00 00 00 00  <span style="background:#ffff66;">00 00 04 60</span>  00 00 00 00  ..9ð......9ð....
'''00000030'''  <span style="background:#ffff66;">00 00 04 60  00 00 23 A0</span>  00 00 00 00  00 00 00 00  ..9ð..@p........
 
{| class="wikitable sortable"
|-
| style="background-color:#515243; color:#FFFFFF;" |'''Name'''
| style="background-color:#515243; color:#FFFFFF;" |'''Offset'''
| style="background-color:#515243; color:#FFFFFF;" |'''Size'''
| style="background-color:#515243; color:#FFFFFF;" |'''Example'''
| style="background-color:#515243; color:#FFFFFF;" |'''Remark'''
|-
| <span style="background:#ff6666;">Magic || 0x00 || 0x04 || 51 52 43 46 || 'QRCF'
|-
| <span style="background:#ff6666;">Version                      || 0x04 || 0x04 || 00 00 01 10 ||
|-
| <span style="background:#ff6666;">File-BIO table start offset                  || 0x08 || 0x04 || 00 00 00 40 ||
|-
| <span style="background:#ff6666;">File-BIO table size        || 0x0C || 0x04 || 00 00 02 CC ||
|-
| <span style="background:#66ff66;">Filename table start offset            || 0x10 || 0x04 || 00 00 03 10 ||
|-
| <span style="background:#66ff66;">Filename table size              || 0x14 || 0x04 || 00 00 01 2B || without the padding at the end
|-
| <span style="background:#ffff66;">File main info start offset || 0x18 || 0x04 || 00 00 04 40 ||
|-
| <span style="background:#ffff66;">File main info size  || 0x1C || 0x04 || 00 00 00 1B || without the padding at the end
|-
| <span style="background:#ffff66;">Filedata table start offset      || 0x20 || 0x04 || 00 00 04 60 ||
|-
| ''Not used''                    || 0x24 || 0x04 || 00 00 00 00 ||
|-
| <span style="background:#ffff66;">Filedata table start offset        || 0x28 || 0x04 || 00 00 04 60 ||
|-
| ''Not used''                    || 0x2C || 0x04 || 00 00 00 00 ||
|-
| <span style="background:#ffff66;">Filedata table start offset        || 0x30 || 0x04 || 00 00 04 60 ||
|-
| <span style="background:#ffff66;">Filedata table size          || 0x34 || 0x04 || 00 00 23 A0 ||
|-
| ''Not used''                    || 0x38 || 0x04 || 00 00 00 00 ||
|-
| ''Not used''                    || 0x3C || 0x04 || 00 00 00 00 ||
|-
|}
 
====File-BIO Table====
Default entry size is 49 bytes (offset 0x30), the last entry is a bit special because is not linked to a file. The '''File-BIO Table''' defines the Offset, Size and Filename pointer of each file contained in the File Table. There is a total padding of 52 bytes (0x34) between each entry but first we have a unique* padding of 92 byte (0x5C) before the first entry starts (see '''Structure File-BIO Table''' below). After that, the first 4 bytes are the Offset and the next 4 bytes are the Size of the file from the '''File Table'''. The padding have a structure which is for every QRC the same. First 8 bytes are compiled of 2x 4 bytes which are always 0x00000018 & 0x00000007. Next 4 bytes are a variable (need more analyzing). Next 16 bytes are compiled of 4x 4 bytes which are always 0x00000000, 0x0000000F, 0x00000002 & 0x0000001C. Next 4 bytes are the pointer for the '''Filename''' from the '''Filename Table'''. Next 4 bytes are the offset within the '''File-BIO Table''' for the next '''Filename pointer'''. Last 16 bytes are compiled of 1x 8 bytes and 2x 4 bytes which are alwys 0xFFFFFFFFFFFFFFFF, 0x00000014 & 0x00000006.
 
* excluding icontext.qrc
 
====Structure File-BIO Table====
Offset (without the 0x40 header in all qrc files)
http://666kb.com/i/cib5c7q4y7rpcx9x1.gif
 
Same on all QRC's till offset 0x70
{| class="wikitable"
| style="background-color:#515243; color:#FFFFFF;" |'''Offset'''
| style="background-color:#515243; color:#FFFFFF;" |'''Size'''
| style="background-color:#515243; color:#FFFFFF;" |'''Example'''
| style="background-color:#515243; color:#FFFFFF;" |'''Remark'''
|-
| 0x00 || 0x08 || 00 00 00 00 00 00 00 00 || similar all qrc files
|-
| 0x08 || 0x08 || FF FF FF FF FF FF FF FF || similar all qrc files
|-
| 0x10 || 0x04 || FF FF FF FF || similar all qrc files
|-
| 0x14 || 0x04 || 00 00 00 1C || similar all qrc files
|-
| 0x18 || 0x04 || 00 00 00 1C || similar all qrc files
|-
| 0x1C || 0x04 || 00 00 00 04 || similar all qrc files
|-
| 0x20 || 0x08 || 00 00 00 00 00 00 00 00 || similar all qrc files
|-
| 0x28 || 0x08 || FF FF FF FF FF FF FF FF || similar all qrc files
|-
| 0x30 || 0x04 || 00 00 00 38 || similar all qrc files: start offset file-bio table
|-
| 0x34 || 0x04 || xx xx xx xx || size body file-bio table
|-
| 0x38 || 0x04 || 00 00 00 0F || similar all qrc files
|-
| 0x3C || 0x04 || 00 00 00 02 || 00 00 00 03 on icontex.qrc
|-
| 0x40 || 0x04 || 00 00 00 1C || similar all qrc files
|-
| 0x44 || 0x04 || FF FF FF FF || similar all qrc files
|-
| 0x48 || 0x04 || 00 00 00 74 || 00 00 00 84 on icontex.qrc : start offset of the Filename pointer entry inside file-bio table
|-
| 0x4C || 0x08 || FF FF FF FF FF FF FF FF || similar all qrc files
|-
| 0x54 || 0x04 || 00 00 00 14 || similar all qrc files
|-
| 0x58 || 0x04 || 00 00 00 06 || similar all qrc files
|-
| 0x5C || 0x04 || 00 00 00 00 || offset of first filedata
|-
| 0x60 || 0x04 || 00 00 01 50 || size of first filedata
|-
| 0x64 || 0x04 || 00 00 00 18 || similar all qrc files
|-
| 0x68 || 0x04 || 00 00 00 07 || similar all qrc files
|-
| 0x6C || 0x04 || 00 00 00 00 || similar all qrc files
|-
| 0x70 || 0x04 || 00 00 00 00 || on icontex here are additional 16 bytes
|-
| 0x74 || 0x04 || 00 00 00 0F || similar all qrc files
|-
| 0x78 || 0x04 || 00 00 00 02 || similar all qrc files
|-
| 0x7C || 0x04 || 00 00 00 1C || similar all qrc files
|-
| 0x80 || 0x04 || 00 00 00 38 || Filename pointer of the first file for the Filename Table
|-
| 0x84 || 0x04 || 00 00 00 B0 || start offset of the next entry for the Filename pointer within the File-BIO Table
|-
|}
 
On icontex.qrc there are additional 16 bytes added on offset 0x70 within the '''File-BIO Table'''
{| class="wikitable"
| style="background-color:#515243; color:#FFFFFF;" |'''Offset'''
| style="background-color:#515243; color:#FFFFFF;" |'''Size'''
| style="background-color:#515243; color:#FFFFFF;" |'''Example'''
| style="background-color:#515243; color:#FFFFFF;" |'''Remark'''
|-
| 0x70 || 0x04 || 00 00 00 00 || on icontex.qrc
|-
| 0x74 || 0x04 || 00 00 00 1B || on icontex.qrc
|-
| 0x78 || 0x04 || 00 00 00 01 || on icontex.qrc
|-
| 0x7C || 0x04 || 00 01 55 D4 || on icontex.qrc (size of .dds uncompressed)
|-
| 0x80 || 0x04 || 00 00 00 00 || similar all qrc files
|-
| 0x84 || 0x04 || 00 00 00 0F || similar all qrc files
|-
| 0x88 || 0x04 || 00 00 00 02 || similar all qrc files
|-
| 0x8C || 0x04 || 00 00 00 1C || similar all qrc files
|-
| 0x90 || 0x04 || 00 00 00 38 || Filename pointer of the first file for the Filename Table
|-
| 0x94 || 0x04 || 00 00 00 B0 || start offset of the next entry for the Filename pointer within the File-BIO Table
|-
|}
 
====Filename Table====
Each entry is composed by:
 
{| class="wikitable"
|-
! Offset !! Length !! Example !! Name !! Notes
|-
| 0x0 || 0x4 || 00000038 || '''Filename Table pointer''' || Same value than in the '''File-BIO Table'''
|-
| 0x4 || ''variable'' || lib/rhm/Clear.fpo || '''File name''' ||
|-
| ''variable'' || 0x1 || 00 || '''NULL byte''' ||
|}
*The end of the table has a padding to align to 0x10 bytes
 
 
For a better understanding of the infos posted in the Structure Table and for a side by side compare about the Filename pointers.
 
<span style="background:#66ff66;">Offset of first entry</span>
 
<span style="background:#e6ec8b;">Size of the body starting on</span> <span style="background:#66ff66;">offset of first entry</span>
 
<span style="background:#ffff66;">Filename pointer</span>
 
<span style="background:#ff6666;">Offset pointer for Filename pointer's within the File-BIO Table</span>
 
<span style="background:#6666ff;">Offset of the File-Data within the File-Data Table</span>
 
<span style="background:#2bffb3;">Size of the File-Data</span>


*Other stuff related with QRC:
'''                    File-BIO Table of rhm.qrc                                                                        Filename Table of rhm.qrc'''
**http://blog.us.playstation.com/2009/09/04/q-games-update-star-dust-dynamic-themes-our-favorite-little-tikiman/
**ps3 standalone visualizer app released by "Q games" (responsibles of XMB design): http://blog.us.playstation.com/2013/08/08/new-ps3-visualizer-app-from-q-games-out-tuesday/ and http://www.ps3hax.net/2013/08/q-games-releases-new-visualizer-music-app-for-ps3-high/
''' Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F                                        Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F'''
''' 00000000  00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF  ........ÿÿÿÿÿÿÿÿ                      00000000  <span style="background:#ffff66;">00 00 00 38</span> 6C 69 62 2F 72 68 6D 2F 43 6C 65 61  ...8lib/rhm/Clea'''
''' 00000010  FF FF FF FF 00 00 00 1C 00 00 00 1C 00 00 00 04  ÿÿÿÿ............                      00000010  72 2E 66 70 6F 00 <span style="background:#ffff66;">00 00 00 74</span> 6C 69 62 2F 72 68  r.fpo....tlib/rh'''
''' 00000020  00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF  ........ÿÿÿÿÿÿÿÿ                      00000020  6D 2F 43 6C 65 61 72 2E 76 70 6F 00 <span style="background:#ffff66;">00 00 00 B0</span>  m/Clear.vpo....°'''
''' 00000030  <span style="background:#66ff66;">00 00 00 38</span> <span style="background:#e6ec8b;">00 00 02 90</span> <span style="background:#66ff66;">00</span> 00 00 0F 00 00 00 02  ...8............                      00000030  6C 69 62 2F 72 68 6D 2F 43 6F 70 79 2E 66 70 6F  lib/rhm/Copy.fpo'''
''' 00000040  00 00 00 1C FF FF FF FF <span style="background:#ff6666;">00 00 00 74</span> FF FF FF FF  ....ÿÿÿÿ...tÿÿÿÿ                      00000040  00 <span style="background:#ffff66;">00 00 00 EC</span> 6C 69 62 2F 72 68 6D 2F 64 65 66  ....ìlib/rhm/def'''
''' 00000050  FF FF FF FF 00 00 00 14 00 00 00 06 <span style="background:#6666ff;">00 00 00 00</span>  ÿÿÿÿ............                      00000050  61 75 6C 74 2E 66 70 6F 00 <span style="background:#ffff66;">00 00 01 28</span> 6C 69 62  ault.fpo....(lib'''
''' 00000060  <span style="background:#2bffb3;">00 00 01 50</span> 00 00 00 18 00 00 00 07 00 00 00 00  ...P............                      00000060  2F 72 68 6D 2F 64 65 66 61 75 6C 74 2E 76 70 6F  /rhm/default.vpo'''
''' 00000070  00 00 00 00 <span style="background:#ff6666;">00</span> 00 00 0F 00 00 00 02 00 00 00 1C  ................                      00000070  00 <span style="background:#ffff66;">00 00 01 64</span> 6C 69 62 2F 67 6C 75 74 69 6C 73  ....dlib/glutils'''
''' 00000080  <span style="background:#ffff66;">00 00 00 38</span> <span style="background:#ff6666;">00 00 00 B0</span> FF FF FF FF FF FF FF FF  ...8...°ÿÿÿÿÿÿÿÿ                      00000080  2F 43 6F 6E 65 46 69 6C 74 65 72 2E 66 70 6F 00  /ConeFilter.fpo.'''
''' 00000090  00 00 00 14 00 00 00 06 <span style="background:#6666ff;">00 00 01 50</span> <span style="background:#2bffb3;">00 00 00 E0</span>  ...........P...à                      00000090  <span style="background:#ffff66;">00 00 01 A0</span> 6C 69 62 2F 67 6C 75 74 69 6C 73 2F  ....lib/glutils/'''
''' 000000A0  00 00 00 18 00 00 00 07 00 00 00 16 00 00 00 00  ................                      000000A0  43 6F 6E 65 46 69 6C 74 65 72 2E 76 70 6F 00 <span style="background:#ffff66;">00</span>  ConeFilter.vpo..'''
''' 000000B0  <span style="background:#ff6666;">00</span> 00 00 0F 00 00 00 02 00 00 00 1C <span style="background:#ffff66;">00 00 00 74</span>  ...............t                      000000B0  <span style="background:#ffff66;">00 01 DC</span> 6C 69 62 2F 67 6C 75 74 69 6C 73 2F 43  ..Ülib/glutils/C'''
''' 000000C0  <span style="background:#ff6666;">00 00 00 EC</span> FF FF FF FF FF FF FF FF 00 00 00 14  ...ìÿÿÿÿÿÿÿÿ....                      000000C0  6F 6E 65 46 69 6C 74 65 72 53 69 6D 70 6C 65 2E  oneFilterSimple.'''
''' 000000D0  00 00 00 06 <span style="background:#6666ff;">00 00 02 30</span> <span style="background:#2bffb3;">00 00 01 20</span> 00 00 00 18  .......0........                      000000D0  66 70 6F 00 <span style="background:#ffff66;">00 00 02 18</span> 6C 69 62 2F 67 6C 75 74  fpo.....lib/glut'''
''' 000000E0  00 00 00 07 00 00 00 2C 00 00 00 00 <span style="background:#ff6666;">00</span> 00 00 0F  .......,........                      000000E0  69 6C 73 2F 53 63 72 65 65 6E 43 6F 70 79 2E 66  ils/ScreenCopy.f'''
''' 000000F0  00 00 00 02 00 00 00 1C <span style="background:#ffff66;">00 00 00 B0</span> <span style="background:#ff6666;">00 00 01 28</span>  ...........°...(                       000000F0  70 6F 00 <span style="background:#ffff66;">00 00 02 54</span> 6C 69 62 2F 67 6C 75 74 69  po....Tlib/gluti'''
''' 00000100  FF FF FF FF FF FF FF FF 00 00 00 14 00 00 00 06  ÿÿÿÿÿÿÿÿ........                      00000100  6C 73 2F 42 6C 75 72 32 2E 66 70 6F 00 00 00 02  ls/Blur2.fpo....'''
''' 00000110  <span style="background:#6666ff;">00 00 03 50</span> <span style="background:#2bffb3;">00 00 01 F0</span> 00 00 00 18 00 00 00 07  ...P...ð........                      00000110  90 6C 69 62 2F 67 6C 75 74 69 6C 73 2F 42 6C 75  .lib/glutils/Blu'''
''' 00000120  00 00 00 41 00 00 00 00 <span style="background:#ff6666;">00</span> 00 00 0F 00 00 00 02  ...A............                       00000120  72 32 4D 61 73 6B 2E 66 70 6F                    r2Mask.fpo'''
''' 00000130  00 00 00 1C <span style="background:#ffff66;">00 00 00 EC</span> <span style="background:#ff6666;">00 00 01 64</span> FF FF FF FF  .......ì...dÿÿÿÿ'''
''' 00000140  FF FF FF FF 00 00 00 14 00 00 00 06 <span style="background:#6666ff;">00 00 05 40</span>  ÿÿÿÿ...........@'''
''' 00000150  <span style="background:#2bffb3;">00 00 08 10</span> 00 00 00 18 00 00 00 07 00 00 00 59  ...............Y'''
''' 00000160  00 00 00 00 <span style="background:#ff6666;">00</span> 00 00 0F 00 00 00 02 00 00 00 1C  ................'''
''' 00000170  <span style="background:#ffff66;">00 00 01 28</span> <span style="background:#ff6666;">00 00 01 A0</span> FF FF FF FF FF FF FF FF  ...(....ÿÿÿÿÿÿÿÿ'''
''' 00000180  00 00 00 14 00 00 00 06 <span style="background:#6666ff;">00 00 0D 50</span> <span style="background:#2bffb3;">00 00 05 50</span>  ...........P...P'''
''' 00000190  00 00 00 18 00 00 00 07 00 00 00 71 00 00 00 00  ...........q....'''
''' 000001A0  <span style="background:#ff6666;">00</span> 00 00 0F 00 00 00 02 00 00 00 1C <span style="background:#ffff66;">00 00 01 64</span>  ...............d'''
''' 000001B0  <span style="background:#ff6666;">00 00 01 DC</span> FF FF FF FF FF FF FF FF 00 00 00 14  ...Üÿÿÿÿÿÿÿÿ....'''
''' 000001C0  00 00 00 06 <span style="background:#6666ff;">00 00 12 A0</span> <span style="background:#2bffb3;">00 00 03 D0</span> 00 00 00 18  ...........Ð....'''
''' 000001D0  00 00 00 07 00 00 00 90 00 00 00 00 <span style="background:#ff6666;">00</span> 00 00 0F  ................'''
''' 000001E0  00 00 00 02 00 00 00 1C <span style="background:#ffff66;">00 00 01 A0</span> <span style="background:#ff6666;">00 00 02 18</span>  ................'''
''' 000001F0  FF FF FF FF FF FF FF FF 00 00 00 14 00 00 00 06  ÿÿÿÿÿÿÿÿ........'''
''' 00000200  <span style="background:#6666ff;">00 00 16 70</span> <span style="background:#2bffb3;">00 00 01 C0</span> 00 00 00 18 00 00 00 07  ...p...À........'''
''' 00000210  00 00 00 AF 00 00 00 00 <span style="background:#ff6666;">00</span> 00 00 0F 00 00 00 02  ...¯............'''
''' 00000220  00 00 00 1C <span style="background:#ffff66;">00 00 01 DC</span> <span style="background:#ff6666;">00 00 02 54</span> FF FF FF FF  .......Ü...Tÿÿÿÿ'''
''' 00000230  FF FF FF FF 00 00 00 14 00 00 00 06 <span style="background:#6666ff;">00 00 18 30</span>  ...............0'''
''' 00000240  <span style="background:#2bffb3;">00 00 03 10</span> 00 00 00 18 00 00 00 07 00 00 00 D4  ...............Ô'''
''' 00000250  00 00 00 00 <span style="background:#ff6666;">00</span> 00 00 0F 00 00 00 02 00 00 00 1C  ................'''
''' 00000260  <span style="background:#ffff66;">00 00 02 18</span> <span style="background:#ff6666;">00 00 02 90</span> FF FF FF FF FF FF FF FF  ........ÿÿÿÿÿÿÿÿ'''
''' 00000270  00 00 00 14 00 00 00 06 <span style="background:#6666ff;">00 00 1B 40</span> <span style="background:#2bffb3;">00 00 04 20</span>  ...........@....'''
''' 00000280  00 00 00 18 00 00 00 07 00 00 00 F3 00 00 00 00  ...........ó....'''
''' 00000290  <span style="background:#ff6666;">00</span> 00 00 0F 00 00 00 02 00 00 00 1C <span style="background:#ffff66;">00 00 02 54</span>  ...............T'''
''' 000002A0  FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 14  ÿÿÿÿÿÿÿÿÿÿÿÿ....'''
''' 000002B0  00 00 00 06 <span style="background:#6666ff;">00 00 1F 60</span> <span style="background:#2bffb3;">00 00 04 40</span> 00 00 00 18  .......`...@....'''
''' 000002C0  00 00 00 07 00 00 01 0D 00 00 00 00              ............'''


== QRC containers ==
====File Main Info====


=== icons.qrc & icontex.qrc ===
The table starts with 0x20 bytes
*See: [[icons.qrc]] and [[icontex.qrc]] pages
{{icons.qrc}}
{{icontex.qrc}}


=== lines.qrc ===
In all the .qrc files (except icontex.qrc)
*See: [[lines.qrc]] page
{{lines.qrc}}
'''Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F'''
'''00000440'''  <span style="background:#ffff66;">71 72 63 00  66 69 6C 65  2D 74 61 62  6C 65 00 66</span>  qrc file-table f
'''00000450'''  <span style="background:#ffff66;">69 6C 65 00  73 72 63 00  69 64 00</span> <span style="background:#ff6666;">00  00 00 00 00</span>  ile src id......


=== rhm.qrc & raf.qrc ===
In icontex.qrc (not in the other .qrc files) [this is similar to a P3T file]
*See: [[rhm.qrc]] and [[raf.qrc]] pages
{{rhm.qrc}}
'''Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F'''
{{raf.qrc}}
'''00000440'''  <span style="background:#ffff66;">71 72 63 00  66 69 6C 65  2D 74 61 62  6C 65 00 66</span>  qrc file-table f
'''00000450'''  <span style="background:#ffff66;">69 6C 65 00  73 72 63 00  69 64 00 73  69 7A 65 00</span>  ile src id size.


=== canyon.qrc & earth.qrc ===
*yellow: used bytes
*See: [[canyon.qrc]] and [[earth.qrc]] pages
*red: padding to align to 0x10 bytes
*Music player visualizers (a.k.a. 'valley' and 'gaia'), the other music player visualizer available is a modification of the [[XMB]] wave/sparks animation, and is stored inside [[lines.qrc]] using specific .MNU settings in path: '''override/music_1/''')
{{canyon.qrc}}
{{earth.qrc}}


=== store.qrc ===
After this, the files are concatenated in the same order than in the '''File-BIO Table''' & '''Filename Table'''
*See: [[store.qrc]] page
{{store.qrc}}


== QRC contents ==
== Tools ==
See [[Multimedia Formats and Tools]] page for a general description of DDS, GTF, BMP, TGA, FPO, VPO and JPEG image formats)


*ELF (Executable and Linkable Format) See Specifications here: [http://www.sco.com/developers/gabi/latest/ch4.eheader.html ELF Header] and [http://www.openwatcom.com/ftp/devel/docs/elf-64-gen.pdf ELF-64 Object File Format]
===ZLIB archivers===
*BIN (Binary)
QRC files are compressed in ZLIB, and has 8 bytes added at the start of the file. To be able to use a generic zlib archiver is needed to remove this 8 bytes (and is needed to add them in the last step when rebuilding the QRC file)
*MNU ?
*PATH (Camera path)
*DUMP ?
*TXT ?
*INI ?
*DDS (Direct Draw Surface)
*GTF (Graphics Texture Format)
*BMP (Bitmap)
*TGA (Targa)
*JPEG (Joint Photographic Experts Group)
*FPO (Fragment Program Objects)
*VPO (Vertex Program Objects)


*QRC files from firmware version 1.00 up and including 4.50 : http://mir.cr/TSR5E8PM (32078 KB RAR / unpacked size 243425713 bytes)
====SimplyZip====
**MD5 hashes generated with quickSFV http://pastebin.com/raw.php?i=ATvKyMRC
Windows archiver able to extract and create zlib files. http://www.paehl.de/cms/simplyzip
**CRC32 hashes generated with quickSFV http://pastebin.com/raw.php?i=40h6iMCA


== QRC related tools ==
*Usage:
**Open the program and click in the tab at top: [External progs] ---> [ZLIB (pack/unpack)]
**A window opens where you can select the file
**Choose [Decompress] or [Compress], then click in [Start]


=== ZLIB ===
==== QGL converter ====
QRC files uses [[Template:Zlib Header|ZLIB]] compression level 9, there are 2 types of QRC files that can be recognized by reading the first 4 bytes either QRCC or QRCF, the next 4 bytes indicates the decompressed size. The first step to extract QRC contents is to remove this 8 bytes at the start of the file. After removed the resulting file is in zlib format
This tool can decompress a QRCC to QRCF and compress a QRCF to QRCC (it crops/generates the first 8 bytes and manages the zlib decompression/compression)


*'''QGL converter''' - This code can decompress a QRCC to QRCF and compress a QRCF to QRCC (it crops/generates the first 8 bytes and manages the zlib decompression/compression) [https://raw.github.com/wargio/ps3tools/master/QGL.c QGL.c]
https://raw.github.com/wargio/ps3tools/master/QGL.c (just run make to compile it)
*'''Zlib GUI v1.0''' - Nice GUI to work with the zlib dll. Download: [http://www.f2065.ru/soft/ZLib_GUI_en.htm official link], or [http://www.psx-place.com/resources/zlib-gui.716/ alternative link]


=== QRC Extractors ===
=== QRC Extractors ===
After the ZLIB decompression (needed for all .qrc files except icontex.qrc) the contents can be extracted individually using different tools
After the ZLIB decompression (needed for all .qrc files except icontex.qrc) the contents can be extracted individually using different tools


*<s>'''P3Textractor''' - Is posible to use a theme extractor to extract the contents from .qrc files, but first is needed to replace the characters '''/''' by '''_''' of the text strings inside the '''Name table''' with a hexeditor (e.g: the string '''override/black/ICONS.mnu''' needs to be replaced by '''override_black_ICONS.mnu''')</s>. Dont use this method, is too much innacurate and obsolete, is kept here only for historical purposes
*Notes
*'''CXML decompiler v4 alpha''' - Is a python script to extract the contents of CXML containers (CXML, QRCF, P3TF, RAFO, etc...), and also generates an .xml that represents the original CXML structure. To use it copy the script at bottom of [[CXML Containers]] page and save it to your PC as '''script.py'''. Then run it from the command line and follow the instructions, it requires [https://www.python.org/downloads/ python 2]
**Some of the images are inverted vertically (only .dds?)
 
==== P3Textractor ====
Is posible to use a theme extractor to extract the contents from .qrc files, but first is needed to replace the characters '''/''' by '''_''' of the text strings inside the '''Name table''' with a hexeditor (e.g: the string '''override/black/ICONS.mnu''' needs to be replaced by '''override_black_ICONS.mnu''')
This patching of the text strings can be automated by selecting the whole '''Name table''' in hexeditor and the function "replace string" (replacing the text string '''/''' by '''_''' automatically only in the selected area)
 
P3Textractor manual: http://www.psdevwiki.com/ps3/Themes_(.p3t)#P3Textractor
 
*Notes
**P3Textractor renames .dds file extensions to .gim in the extraction process... so is needed to change back the file extensions manually to .dds for further edits in other programs
**This same trick with P3Textractor can be used with .raf files
 
=== Raw extractors ===
 
==== Generic Tiny little extractor ====
Theses generic tiny little tools extract '''blindly''' (they just don t want to stop) & embedded (and so, output bigger files when it s not) files and are means to be tiny and independent. Extremely Heavily based on an [http://www.ps3devwiki.com/wiki/Talk:Content_Information_Files MPO splitter] by Christian Steinruecken. Formats supported DDS/MNU/JPG/MPO/PNG (and virtually any other by modifying the source code)
 
http://rghost.net/49340892 (include Code-Compile-Credit. Drag and drop your file into them) &
mirror links: http://mir.cr/0R78ED3U


=== QRC Compilers ===
=== QRC Compilers ===
There are no .qrc compilers, the usual method to modify qrc files is by patching the text strings of the .MNU settings or to inject the custom files with a hexeditor overriting the original .qrc file structure
There are no compilers for .qrc files, the commonly used method consist in patching settings values in text strings (or to inject the modded files) with a hexeditor over the original .qrc file
 
This limits the mods to patches than never exceeeds the size of the original data... in the case of patching an area with an smaller patch is recommended to fill the original "trash" data with zeroes
 
==== Patching strings in hexeditor ====
Mostly used with the settings inside .mnu files
 
First extract the files with some of the extractor tool, open the .mnu files in notepad++ to be able to read the settings in a easy way
 
Select the string you want to modify and "copy" his name
 
Open the .qrc file in hexeditor (after ZLIB decompression if needed) and use the search funtion to locate the string you copyed previously
 
*Notes
**Most of the settings inside .mnu files are repeated several times inside the .qrc file because are used in several .mnu files... be sure to patch the correct .mnu file by comparing the rest of the data at his side
 
==== Injecting files in hexeditor ====
Similar than patching a text string, but with a bigger chunk of data
 
== Files inside QRC containers ==
*File formats inside QRC containers: (See [[Multimedia Formats and Tools]] page for a general description of DDS, GTF, BMP, TGA, and JPEG image formats)
**ELF (Executable and Linkable Format) See Specifications here: [http://www.sco.com/developers/gabi/latest/ch4.eheader.html ELF Header] and [http://www.openwatcom.com/ftp/devel/docs/elf-64-gen.pdf ELF-64 Object File Format]
**BIN (Binary)
**MNU ?
**FPO (Fragment program objects)
**VPO (Vertex program objects)
**PATH (Camera path)
**DUMP ?
**TXT ?
**INI ?
**DDS (Direct Draw Surface)
**GTF (Graphics Texture Format)
**BMP (Bitmap)
**TGA (Targa)
**JPEG (Joint Photographic Experts Group)


The patches should never exceeed the size of the original data, incase of patching an predefined area with an smaller patch is recommended to "blank" the original data with zeroes before writing the new data
*ps3 standalone visualizer app released by "Q games" (responsibles of XMB design): http://blog.us.playstation.com/2013/08/08/new-ps3-visualizer-app-from-q-games-out-tuesday/ and http://www.ps3hax.net/2013/08/q-games-releases-new-visualizer-music-app-for-ps3-high/


The format allows also to "remap" the contained files by modifying the entries in the index to make them point to the offset/size of a different file
*QRC related modules in '''dev_flashvsh/modules/''':
**qglbase.sprx <--- generic
**qgl_gaia_app.sprx <--- earth animation inside music player
**qgl_canyon_app.sprx <--- abstract animation inside music player
**Indirectly related: raf.sprx <--- generic animations


*'''Patching strings in hexeditor'''
===lines.qrc===
**Mostly used with the settings inside .mnu files
{{lines.qrc}}
**First extract the files with the CXML decompiler script, look at the main .xml to identify the file names, open the .mnu file you want to modify in notepad++ to be able to read the settings in a easy way
**Select the string you want to modify and copy it
**Open the .qrc file in a hexeditor (after ZLIB decompression if needed) and use the search funtion to locate the string you copyed in the previous step
**Notes
***Most of the settings from .mnu files are repeated several times inside the .qrc file. Be sure to patch the correct .mnu file by comparing the data before or/and after


*'''Injecting files in hexeditor'''
===icons.qrc & icontex.qrc===
**Similar than patching a text string but with a bigger chunk of data
{{icons.qrc}}
{{icontex.qrc}}


== External Links ==
===rhm.qrc & raf.qrc===
*QRC modding by eustolio: http://www.scenespain.net/foro/tutoriales-ps3/tutorial-xmb-custom-cambia-el-color-e-iconos-base-del-xmb/ (2011 may 29)
{{rhm.qrc}}
**Corrections: None :)
{{raf.qrc}}
*XMB wave modding by glowball: http://www.ps3hax.net/showthread.php?t=25618 (2011 july 1) and http://www.ps3hax.net/showthread.php?t=58673 (2013 july 4)
 
**Corrections:
===canyon.qrc & earth.qrc===
***The concept of PAL/NTSC wave is wrong. The wave is common for all PS3 models, resolutions, aspect ratios, and regions. The 8 bytes at the start of the file doesnt has any relationship with PAL/NTSC
Music player visualizers
***There is no javascript inside the QRC container, the supposed .js file used in glowball method is a chunk of data containing several .mnu files (included the padding between them)
*note1: the other music player visualizer available is a modification of the [[XMB]] wave/sparks animation, and is stored inside [[lines.qrc]] using specific .MNU settings in path: '''override/music_1/''')
***The idea of an "imaginary" javascript hides the real explain of the structure or what you are patching, making users to dont understand a word and promoting the "blind testing"
 
***In the case you want to patch 1 byte... you are patching a huge area instead
{{canyon.qrc}}
***Using hardcoded offsets is a safe way to break compatility when the files changes in with newer firmwares and good for softbricking, there is no advise of incompatibility problems
{{earth.qrc}}
 
===store.qrc===
{{store.qrc}}


*Qt Framework
**http://qt-project.org/doc/qt-5/rcc.html
**http://qt-project.org/doc/qt-5/resources.html
**https://qt.gitorious.org/qt/qtbase/source/fb20f9c2da369b07fc50857a90b596ae63f943da:src/tools/rcc
**https://qt.gitorious.org/qt-creator/qt-creator/source/1154a8c6c2bfb223f4239d7902c3755e8a9a1213:src/plugins/resourceeditor/qrceditor




{{File Formats}}<noinclude>[[Category:Main]]</noinclude>
{{File Formats}}<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)