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 ==
[[Category:Software]]
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]
location: /dev_flash/vsh/resource/qgl


The internal structure of QRC files can be clasifyed as one of the variants of a group of containers named: [[CXML Containers]]
== General format ==
ZLIB Compressing level 9.


*QRC related firmware modules in '''dev_flashvsh/modules/''':
=== QRCC ===
**qglbase.sprx <--- generic
Compressed (QRCC) file (example from 3.55 lines.qrc):
**qgl_gaia_app.sprx <--- earth animation inside music player
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
**qgl_canyon_app.sprx <--- abstract animation inside music player
00000000  51 52 43 43 00 08 7A 60                          QRCC..z`
**custom_render_plugin.sprx


*Other stuff related with QRC:
51 52 43 43  magic header 'QRCC'
**http://blog.us.playstation.com/2009/09/04/q-games-update-star-dust-dynamic-themes-our-favorite-little-tikiman/
00            divisor
**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/
08 7A 60      size of ZLIB unpacked (QRCF) file


== QRC containers ==
=== QRCF ===
unpacked (QRCF) file (example from 3.55 lines.qrc):
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  51 52 43 46 00 00 01 10 00 00 00 40 00 00 25 7C  QRCF.......@..%|
00000010  00 00 25 C0 00 00 14 02 00 00 39 D0 00 00 00 1B  ..%À......9Ð....
00000020  00 00 39 F0 00 00 00 00 00 00 39 F0 00 00 00 00  ..9ð......9ð....
00000030  00 00 39 F0 00 08 40 70 00 00 00 00 00 00 00 00  ..9ð..@p........


=== icons.qrc & icontex.qrc ===
51 52 43 46  magic header 'QRCF'
*See: [[icons.qrc]] and [[icontex.qrc]] pages
00            divisor
{{icons.qrc}}
xx xx xx xx  size of file sections
{{icontex.qrc}}


=== lines.qrc ===
*See: [[lines.qrc]] page
{{lines.qrc}}


=== rhm.qrc & raf.qrc ===
== Mods ==
*See: [[rhm.qrc]] and [[raf.qrc]] pages
=== canyon.qrc ===
{{rhm.qrc}}
location: /dev_flash/vsh/resource/qgl
{{raf.qrc}}


=== canyon.qrc & earth.qrc ===
=== earth.qrc ===
*See: [[canyon.qrc]] and [[earth.qrc]] pages
location: /dev_flash/vsh/resource/qgl
*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 ===
=== icons.qrc ===
*See: [[store.qrc]] page
location: /dev_flash/vsh/resource/qgl
{{store.qrc}}


== QRC contents ==
=== icontex.qrc ===
See [[Multimedia Formats and Tools]] page for a general description of DDS, GTF, BMP, TGA, FPO, VPO and JPEG image formats)
location: /dev_flash/vsh/resource/qgl


*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]
=== lines.qrc ===
*BIN (Binary)
location: /dev_flash/vsh/resource/qgl
*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)
*XMB wave modding: http://www.ps3hax.net/showthread.php?t=25618 and http://www.ps3hax.net/showthread.php?t=58673
**MD5 hashes generated with quickSFV http://pastebin.com/raw.php?i=ATvKyMRC
**CRC32 hashes generated with quickSFV http://pastebin.com/raw.php?i=40h6iMCA


== QRC related tools ==
----
Notes (this section is speculative until someone finds where the values are stored, feel free to improve it)


=== ZLIB ===
'''Sparks dynamic animation''' (sparks movement affected by cursor position and "fluid density")
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


*'''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]
The sparks movement is affected by the displacement of the cursor when moving along XMB columns and rows (left-right, or up-down directions). When the cursor moves fast to a new position the sparks "tends" to move in the opposite direction trying to mimic a real fluid like air or water
*'''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 ===
To see this effect is good to configure a black wallpaper and enable all the options iside "theme settings" to "original" (this will make the sparks very visibles). Then start moving the cursor from top-left column (user) <---> to top-right column (friends)... or from top item <---> to bottom item in any colums (more visible in a column with several items, like game)... and note how the sparks directions are affected :)
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
This proves the sparks is a dynamic animation, is constantly "reading" the position of the cursor to adjust particle directions
*'''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]


=== QRC Compilers ===
=== raf.qrc ===
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
location: /dev_flash/vsh/resource/qgl


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
=== rhm.qrc ===
location: /dev_flash/vsh/resource/qgl


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
=== store.qrc ===
location: /dev_flash/vsh/resource/qgl


*'''Patching strings in hexeditor'''
<!--// perhaps great to have screenshots + samples per each item and its useage explained //-->
**Mostly used with the settings inside .mnu files
<!--// see also : http://www.ps3hax.net/showthread.php?t=25618 //-->
**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'''
== Tools ==
**Similar than patching a text string but with a bigger chunk of data


== External Links ==
=== QGL ===
*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)
*this tool can decompress a QRCC to QRCF and compress a QRCF to QRCC
**Corrections: None :)
*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:
***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
***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)
***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
***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


*Qt Framework
https://raw.github.com/wargio/ps3tools/master/QGL.c (just run make to compile it)
**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


=== DDS ===
*This tiny tool can extract embedded .dds, heavily based on an [http://www.ps3devwiki.com/wiki/Talk:Content_Information_Files MPO splitter] by Christian Steinruecken.


{{File Formats}}<noinclude>[[Category:Main]]</noinclude>
http://rghost.net/47483926 (include Code-Compile-Credit. Drag and drop your file with embedded .dds)
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)