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 ==
== Description ==
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]
QRC files ('''Q'''t '''R'''esources '''C'''ontainer) are part of the firmware, located inside a QGL folder ('''Q'''t '''G'''raphics '''L'''ibrary) in path: '''dev_flash/vsh/resource/qgl''' using 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]]
*All QRC files uses zlib compression and the same container, and only contains "files" inside a "file-table", but the zlib compression method and the structure of the container has 2 variations:
**'''QRCC''' - (used by all .qrc files except icontex.qrc) - zlib compression is applyed over the whole .qrc file (except his first 8 bytes that are info for the decompression), after decompression the file generated is a QRCF and the internal container structure can be readed (QRCC always contains a QRCF that is the real container)
**'''QRCF''' - (used only by icontex.qrc) - zlib compression is applyed per-file over each contained file (the container structure can be readed directlly and every one of the files inside the container structure is compressed individually)


*QRC related firmware modules in '''dev_flashvsh/modules/''':
In the practise and from the point of view of the system, the QRCC has no interest and is needed to decompress the whole QRCC to be able to read the internal structure of the container and to acess individual files, when a QRCC is decompressed it generates an QRCF file (the real container) but this QRCF has a different internal structure than the QRCF used by icontex.qrc (are 2 variations of the same container with some small differences... althougth both uses the same identifyer QRCF)
**qglbase.sprx <--- generic
 
**qgl_gaia_app.sprx <--- earth animation inside music player
==QRC structure==
**qgl_canyon_app.sprx <--- abstract animation inside music player
See: [[CXML Containers]] page
**custom_render_plugin.sprx
 
== Tools ==
 
===ZLIB archivers===
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)
 
====SimplyZip====
Windows archiver able to extract and create zlib files. http://www.paehl.de/cms/simplyzip
 
*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]
 
==== QGL converter ====
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)
 
https://raw.github.com/wargio/ps3tools/master/QGL.c (just run make to compile it)
 
=== QRC Extractors ===
After the ZLIB decompression (needed for all .qrc files except icontex.qrc) the contents can be extracted individually using different tools
 
*Notes
**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)


*Other stuff related with QRC:
http://rghost.net/49340892 (include Code-Compile-Credit. Drag and drop your file into them) &
**http://blog.us.playstation.com/2009/09/04/q-games-update-star-dust-dynamic-themes-our-favorite-little-tikiman/
mirror links: http://mir.cr/0R78ED3U
**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/


== QRC containers ==
=== QRC Compilers ===
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


=== icons.qrc & icontex.qrc ===
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
*See: [[icons.qrc]] and [[icontex.qrc]] pages
{{icons.qrc}}
{{icontex.qrc}}


=== lines.qrc ===
==== Patching strings in hexeditor ====
*See: [[lines.qrc]] page
Mostly used with the settings inside .mnu files
{{lines.qrc}}


=== rhm.qrc & raf.qrc ===
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
*See: [[rhm.qrc]] and [[raf.qrc]] pages
{{rhm.qrc}}
{{raf.qrc}}


=== canyon.qrc & earth.qrc ===
Select the string you want to modify and "copy" his name
*See: [[canyon.qrc]] and [[earth.qrc]] pages
*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 ===
Open the .qrc file in hexeditor (after ZLIB decompression if needed) and use the search funtion to locate the string you copyed previously
*See: [[store.qrc]] page
{{store.qrc}}


== QRC contents ==
*Notes
See [[Multimedia Formats and Tools]] page for a general description of DDS, GTF, BMP, TGA, FPO, VPO and JPEG image formats)
**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


*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]
==== Injecting files in hexeditor ====
*BIN (Binary)
Similar than patching a text string, but with a bigger chunk of data
*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)


== Files inside QRC containers ==
*QRC files from firmware version 1.00 up and including 4.50 : http://mir.cr/TSR5E8PM (32078 KB RAR / unpacked size 243425713 bytes)
*QRC files from firmware version 1.00 up and including 4.50 : http://mir.cr/TSR5E8PM (32078 KB RAR / unpacked size 243425713 bytes)
**MD5 hashes generated with quickSFV http://pastebin.com/raw.php?i=ATvKyMRC
**MD5 hashes generated with quickSFV http://pastebin.com/raw.php?i=ATvKyMRC
**CRC32 hashes generated with quickSFV http://pastebin.com/raw.php?i=40h6iMCA
**CRC32 hashes generated with quickSFV http://pastebin.com/raw.php?i=40h6iMCA


== QRC related tools ==
*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)


=== ZLIB ===
*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/
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]
*QRC related modules in '''dev_flashvsh/modules/''':
*'''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]
**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


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


*<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
===icons.qrc & icontex.qrc===
*'''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]
{{icons.qrc}}
{{icontex.qrc}}


=== QRC Compilers ===
===rhm.qrc & 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
{{rhm.qrc}}
{{raf.qrc}}


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
===canyon.qrc & earth.qrc===
Music player visualizers
*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 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
{{canyon.qrc}}
{{earth.qrc}}


*'''Patching strings in hexeditor'''
===store.qrc===
**Mostly used with the settings inside .mnu files
{{store.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'''
**Similar than patching a text string but with a bigger chunk of data


== External Links ==
==External Links==
*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)
*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)
**Corrections: None :)
**Corrections: None :)
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)