Resource Container CXML (RCO, QRC, Theme Files, RAF, CXML): Difference between revisions

From Vita Developer wiki
Jump to navigation Jump to search
(34 intermediate revisions by 3 users not shown)
Line 9: Line 9:


[http://www.file-upload.net/download-9992747/Desktop.rar.html Some RCO as Reference]
[http://www.file-upload.net/download-9992747/Desktop.rar.html Some RCO as Reference]
[https://bitbucket.org/SilicaAndPina/cxml-decompiler CXML Decompiler and Compiler]
There is also a cxml compiler labled "cxml.py" inside the [https://archive.org/download/PlayStationMobile/Development%20Tools/SDK/PSM_SDK_2.00.00.exe PSM SDK] @ %SCE_PSM_SDK%\tools\PublishingUtility\cxml\compiler as this is the format of [[app.info]]


{| class="wikitable" style="font-size:x-small;"
{| class="wikitable" style="font-size:x-small;"
Line 36: Line 40:
| 0x24 || 0x04 || F1 01 00 00 || Strings table size || in PS3 = Integer array size
| 0x24 || 0x04 || F1 01 00 00 || Strings table size || in PS3 = Integer array size
|- bgcolor="#ffeebb"
|- bgcolor="#ffeebb"
| 0x28 || 0x04 || D0 18 00 00 || overlapped (not used, but present in the header to keep the structure standards) || in PS3 = Float array absolute start offset
| 0x28 || 0x04 || D0 18 00 00 || Char table absolute start offset || in PS3 = Float array absolute start offset
|- bgcolor="#ffeebb"
|- bgcolor="#ffeebb"
| 0x2C || 0x04 || 00 00 00 00 || empty || in PS3 = Float array size
| 0x2C || 0x04 || 00 00 00 00 || Char table size || in PS3 = Float array size
|- bgcolor="#ffee99"
|- bgcolor="#ffee99"
| 0x30 || 0x04 || D0 18 00 00 || Styles ID INT table absolute start offset || in PS3 = File table absolute start offset
| 0x30 || 0x04 || D0 18 00 00 || Hash ID INT table absolute start offset || in PS3 = File table absolute start offset
|- bgcolor="#ffee99"
|- bgcolor="#ffee99"
| 0x34 || 0x04 || 34 00 00 00 || Styles ID INT table size || in PS3 = File table size
| 0x34 || 0x04 || 34 00 00 00 || Hash ID INT table size || in PS3 = File table size
|- bgcolor="#ffee77"
|- bgcolor="#ffee77"
| 0x38 || 0x04 || 10 19 00 00 || Integer array absolute start offset || in PS3 = Unknown area absolute start offset
| 0x38 || 0x04 || 10 19 00 00 || Integer array absolute start offset || in PS3 = Unknown area absolute start offset
Line 64: Line 68:
==XML implicit structure Overview==
==XML implicit structure Overview==


  namespace cxml
  namespace cxml {
{
    class cxml : public Base {
struct Header { /*header of a cxml document*/
        struct Header { /*header of a cxml document*/
                char magic[4];
            char magic[4];
                int version;
            int version;
                int tree_offset;
            int tree_offset;
                int tree_size;
            int tree_size;
                int idstrtable_offset;
            int idstrtable_offset;
                int idstrtable_size;
            int idstrtable_size;
                int idinttable_offset;
            int idinttable_offset;
                int idinttable_size;
            int idinttable_size;
                int stringtable_offset;
            int stringtable_offset;
                int stringtable_size;
            int stringtable_size;
                int styleidtable_offset;
            int chartable_offset;
                int styleidtable_size;
            int chartable_size;
                int intarraytable_offset;
            int hashidtable_offset;
                int intarraytable_size;
            int hashidtable_size;
                int floatarraytable_offset;
            int intarraytable_offset;
                int floatarraytable_size;
            int intarraytable_size;
                int filetable_offset;
            int floatarraytable_offset;
                int filetable_size;
            int floatarraytable_size;
        };
            int filetable_offset;
            int filetable_size;
        };
          
          
        struct ChildElementBin
        struct ChildElementBin {
        {
            int name;
                int name;
            int attr_num;
                int attr_num;
            int parent_node;
                int parent;
            int prev_sibling;
                int prev;
            int next_sibling;
                int next;
            int first_child;
                int first_child;
            int last_child;
                int last_child;
            AttributeBin attribute;
        };
        };
          
          
        struct BrotherElementBin
        struct SiblingElementBin {
        {
            int name;
                int name;
            int attr_num;
                int attr_num;
            int parent_node;
                int parent;
            int prev_sibling;
                int prev;
            int next_sibling;
                int next;
            AttributeBin attribute;
        };
        };
          
          
        struct AttributeBin
        struct AttributeBin {
        {
            typedef enum {
                int INTEGER = 1;
                NONE,
                int FLOAT = 2;
                INTEGER,
                int STRING = 3;
                FLOAT,
                int unk = 4;
                STRING,
                int STYLE_ID = 5;
                CHAR,
                int INTEGER_ARRAY = 6;
                HASH_ID,
                int FLOAT_ARRAY = 7;
                INTEGER_ARRAY,
                int DATA = 8;
                FLOAT_ARRAY,
                int ID_STR_REF = 9;
                DATA,
                int ID_STR_NO_REF = 10;
                ID_STR_LPB,
                int ID_INT_REF = 11;
                ID_STR,
                int ID_INT_NO_REF = 12;
                ID_INT_LPB,
                int name;
                ID_INT,
                int type;
            } TYPE;
            int name;
            TYPE type;
            struct SingleValue {
                int intValue;
                float floatValue;      
            };
            struct StringData {
                int offset;
                int len;
            };
   
   
                struct StringData
            struct CharData {
                {
                int offset;
                        int offset;
                int len;
                        int len;
            };
                };
                  
                  
                struct IntArrayData
            struct IntArrayData {
                {
                int offset;
                        int offset;
                int num;
                        int num;
            };
                };
                  
                  
                struct FloatArrayData
            struct FloatArrayData {
                {
                int offset;
                        int offset;
                int num;
                        int num;
            };
                };
                
                
                struct FileData
            struct FileData {
                {
                int offset;
                        int offset;
                int size;
                        int size;
            };
                };
            struct IdStringTableData {
                int offset;
                bool loopback;
            };
            struct IdIntegerTableData {
                int offset;
                bool loopback;
            };
                  
                  
                union
            union {
                {
                int i;
                        int i;
                float f;
                        float f;
                StringData s;
                        StringData s;
                CharData c;
                        IntArrayData ia;
                IntArrayData ia;
                        FloatArrayData fa;
                FloatArrayData fa;
                        FileData file;
                FileData file;
                        int id;
                int id;
                        int idref;
                int idref;
                };
            };
        };
        };
          
          
        struct IDBin
        struct IDBin {
        {
            int entity_offset;
                int entity_offset;
            char id[0];
                char id[0];
        };
        };
          
          
        enum AllocationType
        enum AllocationType {
        {
            AllocationType_Alloc_Tree,
                AllocationType_Alloc_Tree,
            AllocationType_Alloc_IDSTRTable,
                AllocationType_Alloc_IDSTRTable,
            AllocationType_Alloc_IDINTTable,
                AllocationType_Alloc_IDINTTable,
            AllocationType_Alloc_StringTable,
                AllocationType_Alloc_StringTable,
            AllocationType_Alloc_CharTable,
                AllocationType_Alloc_IntArrayTable,
            AllocationType_Alloc_IntArrayTable,
                AllocationType_Alloc_FloatArrayTable,
            AllocationType_Alloc_FloatArrayTable,
                AllocationType_Alloc_FileTable,
            AllocationType_Alloc_FileTable,
                AllocationType_Alloc_StyleIDTable,
            AllocationType_Alloc_HashIDTable,
    
    
                AllocationType_Free_Tree,
            AllocationType_Free_Tree,
                AllocationType_Free_IDSTRTable,
            AllocationType_Free_IDSTRTable,
                AllocationType_Free_IDINTTable,
            AllocationType_Free_IDINTTable,
                AllocationType_Free_StringTable,
            AllocationType_Free_StringTable,
                AllocationType_Free_IntArrayTable,
            AllocationType_Free_CharTable,
                AllocationType_Free_FloatArrayTable,
            AllocationType_Free_IntArrayTable,
                AllocationType_Free_FileTable,
            AllocationType_Free_FloatArrayTable,
                AllocationType_AFree_StyleIDTable,
            AllocationType_Free_FileTable,
        };
            AllocationType_AFree_HashIDTable,
        };
        
        
        enum AccessMode
        enum AccessMode {
        {
            AccessMode_ReadWrite,
                AccessMode_ReadWrite,
            AccessMode_ReadOnly_File,
                AccessMode_ReadOnly_File,
            AccessMode_ReadOnly_Memory,
                AccessMode_ReadOnly_Memory,
        };
        };
          
          
        class Document {
        class Document {
        public:
        public:
                typedef void (*Allocator)( AllocationType type, void * userdata, void * old_addr, unsigned int required_size, void ** addr, unsigned int * size );
            typedef void (*Allocator)( AllocationType type, void * userdata, void * old_addr, unsigned int required_size, void ** addr, unsigned int * size );
          
          
        private:
        private:
                AccessMode access_mode;
            AccessMode access_mode;
                Header header;
            Header header;
                char * tree;
            char *tree;
                unsigned int tree_capacity;
            unsigned int tree_capacity;
                char * idstrtable;
            char *idstrtable;
                unsigned int idstrtable_capacity;
            unsigned int idstrtable_capacity;
                char * idinttable;
            char *idinttable;
                unsigned int idinttable_capacity;
            unsigned int idinttable_capacity;
                char * stringtable;
            char *stringtable;
                unsigned int stringtable_capacity;
            unsigned int stringtable_capacity;
                int * intarraytable;
            char *chartable;
                unsigned int intarraytable_capacity;
            unsigned int chartable_capacity;
                float * floatarraytable;
            int *intarraytable;
                unsigned int floatarraytable_capacity;
            unsigned int intarraytable_capacity;
                char * filetable;
            float *floatarraytable;
                unsigned int filetable_capacity;
            unsigned int floatarraytable_capacity;
                char * styleidtable;
            char *filetable;
                unsigned int styleidtable_capacity;
            unsigned int filetable_capacity;
                Allocator allocator;
            char *hashidtable;
                void * allocator_userdata;
            unsigned int hashidtable_capacity;
        };
            Allocator allocator;
            void *allocator_userdata;
        };
          
          
        class Element {
        class Element {
        private:
        private:
                Document * doc;
            Document *doc;
                int offset;
            int offset;
        };
        };
        
        
        class Attribute {
        class Attribute {
        private:
        private:
                Document * doc;
            Document *doc;
                int element_offset;
            int element_offset;
                int offset;
            int offset;
        };
        };
        /// <summary>
        /// Initializes this class. Some times also called Constructore.
        /// </summary>
        void Initialize() {
            // All stuff that need to be set before running any function call...
            // goes into here.
        };
    };
  };
  };


Line 247: Line 282:
| 0x08 || 0x04 || Parent relative offset in '''TOC'''
| 0x08 || 0x04 || Parent relative offset in '''TOC'''
|-
|-
| 0x0C || 0x04 || Previous Brother relative offset in '''TOC'''
| 0x0C || 0x04 || Previous Sibling relative offset in '''TOC'''
|-
|-
| 0x10 || 0x04 || Next Brother relative offset in '''TOC'''
| 0x10 || 0x04 || Next Sibling relative offset in '''TOC'''
|-
|-
| 0x14 || 0x04 || First child relative offset in '''TOC'''
| 0x14 || 0x04 || First child relative offset in '''TOC'''
Line 255: Line 290:
| 0x18 || 0x04 || Last child relative offset in '''TOC'''
| 0x18 || 0x04 || Last child relative offset in '''TOC'''
|}
|}
Length is 7 x 4 bytes == 28 bytes (0x1C).


{| class="wikitable" style="text-align:center;"
{| class="wikitable" style="text-align:center;"
|+ CXML Brother Element definition
|+ CXML Sibling Element definition
! Offset !! Length !! usage
! Offset !! Length !! usage
|-
|-
Line 266: Line 303:
| 0x08 || 0x04 || Parent relative offset in '''TOC'''
| 0x08 || 0x04 || Parent relative offset in '''TOC'''
|-
|-
| 0x0C || 0x04 || Previous Brother relative offset in '''TOC'''
| 0x0C || 0x04 || Previous Sibling relative offset in '''TOC'''
|-
|-
| 0x10 || 0x04 || Next Brother relative offset in '''TOC'''
| 0x10 || 0x04 || Next Sibling relative offset in '''TOC'''
|}
|}
*NOTE: The '''Child Element''' defination describe the Child Element and his Attributes where the '''Brother Element''' describe the Brother Element and his Attributes.
Length is 5 x 4 bytes == 20 bytes (0x14).
So the full order to read will be '''Child Element''' >>> '''Attributes''', '''Brother Element''' >>> '''Attributes'''. The Root (so offset 0x00) of any SonyPlaystation Resource file always start's with a Child element to read.
 
NOTE:
*The '''Child Element''' defination describe the Child Element without his Attributes where the '''Sibling Element''' describe the Sibling Element also without his Attributes.
*So the full order to read will be '''Child Element''' >>> '''Attributes''', '''Sibling Element''' >>> '''Attributes'''. The Root (so offset 0x00) of any SonyPlaystation Resource file always start's with a Child element to read.


===Attribute===
===Attribute===
Line 281: Line 321:
|-
|-
! Attribute type<BR />(offset 0x4, length 0x4)
! Attribute type<BR />(offset 0x4, length 0x4)
! 1<BR />(Single Integer) !! 2<BR />(Single Float) !! 3<BR />(String) !! 4<BR />(analysing...) !! 5<BR />(ID STYLE) !! 6<BR />(Integer Array) !! 7<BR />(Float Array) !! 8<BR />(File) !! 9<BR />(ID STR w lpb Ref) !! A<BR />(ID STR wo lpb Ref) !! B<BR />(ID INT w lpb Ref) !! C<BR />(ID INT wo lpb Ref)
! 1<BR />(Single Integer) !! 2<BR />(Single Float) !! 3<BR />(String) !! 4<BR />(Char) !! 5<BR />(ID HASH) !! 6<BR />(Integer Array) !! 7<BR />(Float Array) !! 8<BR />(File) !! 9<BR />(ID STR w lpb Ref) !! A<BR />(ID STR wo lpb Ref) !! B<BR />(ID INT w lpb Ref) !! C<BR />(ID INT wo lpb Ref)
|-
|-
! variable 1<BR />(offset 0x8, length 0x4)
! variable 1<BR />(offset 0x8, length 0x4)
| Integer value || Float value || '''Strings Table''' offset || analysing... || '''ID STYLE Table''' offset || '''Integer Arrays Table''' offset || '''Float Arrays Table''' offset || '''Files Table''' offset || '''ID STR Table''' offset || '''ID STR Table''' offset || '''ID INT Table''' offset || '''ID INT Table''' offset
| Integer value || Float value || '''Strings Table''' offset || '''Chars Table''' offset || '''ID HASH Table''' offset || '''Integer Arrays Table''' offset || '''Float Arrays Table''' offset || '''Files Table''' offset || '''ID STR Table''' offset || '''ID STR Table''' offset || '''ID INT Table''' offset || '''ID INT Table''' offset
|-
|-
! variable 2<BR />(offset 0xC, length 0x4)
! variable 2<BR />(offset 0xC, length 0x4)
| {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || String length || analysing... || Nr. of int's to read (always 4) || Nr. of int's to read || Nr. of float's to read || File size || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr>
| {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || String length || Char length || int's to read (always 4) || Nr. of int's to read || Nr. of float's to read || File size || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr> || {{cellcolors|#ffaaaa}} Not used <abbr title="(always 0 in the samples found)">(always 0)</abbr>
|}
|}
  * w = with || wo = without || lpb = loopback
  * w = with || wo = without || lpb = loopback
Line 295: Line 335:
ZLIB Compressed level 9 (only container)
ZLIB Compressed level 9 (only container)


==== RCOF ====
==== RCOF / RCSF ====
RCOF ('''R'''esources '''C'''ontainer '''F'''lat?)
RCOF ('''R'''esources '''C'''ontainer '''O'''bject '''F'''ile)<br />
RCSF ('''R'''esources '''C'''ontainer '''S'''tring '''F'''ile)


*Example from FW?? notification_settings_plugin.rco:
*Example from FW?? notification_settings_plugin.rco:
Line 307: Line 348:
|-
|-
| Magic || 0x00 || 0x04 || {{cellcolors|#666666|#ffffff}} 52 43 4F 46 || 'RCOF'
| Magic || 0x00 || 0x04 || {{cellcolors|#666666|#ffffff}} 52 43 4F 46 || 'RCOF'
|-
| Version || 0x04 || 0x04 || {{cellcolors|#888888|#ffffff}} 00 00 01 10* || CXML version '1.10'
|-
|}
'''Offset(h) 00 01 02 03  04 05 06 07'''
'''00000000'''  <span style="background:#666666;">52 43 53 46</span>  <span style="background:#888888;">10 01 00 00</span> RCSF....
{| class="wikitable"
|-
! Name !! Offset !! Size !! Example !! Remark
|-
| Magic || 0x00 || 0x04 || {{cellcolors|#666666|#ffffff}} 52 43 53 46 || 'RCSF'
|-
|-
| Version || 0x04 || 0x04 || {{cellcolors|#888888|#ffffff}} 00 00 01 10* || CXML version '1.10'
| Version || 0x04 || 0x04 || {{cellcolors|#888888|#ffffff}} 00 00 01 10* || CXML version '1.10'
Line 325: Line 380:
**one of the "not used table" (at offset 0x18D0 with a size of 0) is placed before an used table (also at offset 0x18D0 but with a size of  0x34)
**one of the "not used table" (at offset 0x18D0 with a size of 0) is placed before an used table (also at offset 0x18D0 but with a size of  0x34)


 
====RCOF====
  '''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'''  <span style="background:#666666;">52 43 4F 46</span>  <span style="background:#666666;">10 01 00 00</span>  <span style="background:#ff8888;">50 00 00 00</span>  <span style="background:#ff8888;">2C 15 00 00</span>  RCOF....P...,...
  '''00000000'''  <span style="background:#666666;">52 43 4F 46</span>  <span style="background:#666666;">10 01 00 00</span>  <span style="background:#ff8888;">50 00 00 00</span>  <span style="background:#ff8888;">2C 15 00 00</span>  RCOF....P...,...
Line 332: Line 387:
  '''00000030'''  <span style="background:#ffee99;">D0 18 00 00</span>  <span style="background:#ffee99;">34 00 00 00</span>  <span style="background:#ffee77;">10 19 00 00</span>  <span style="background:#ffee77;">2C 00 00 00</span>  Ð...4.......,...
  '''00000030'''  <span style="background:#ffee99;">D0 18 00 00</span>  <span style="background:#ffee99;">34 00 00 00</span>  <span style="background:#ffee77;">10 19 00 00</span>  <span style="background:#ffee77;">2C 00 00 00</span>  Ð...4.......,...
  '''00000040'''  <span style="background:#ffee55;">40 19 00 00</span>  <span style="background:#ffee55;">8C 00 00 00</span>  <span style="background:#ffee33;">D0 19 00 00</span>  <span style="background:#ffee33;">60 89 00 00</span>  @...Œ...Ð...`‰..
  '''00000040'''  <span style="background:#ffee55;">40 19 00 00</span>  <span style="background:#ffee55;">8C 00 00 00</span>  <span style="background:#ffee33;">D0 19 00 00</span>  <span style="background:#ffee33;">60 89 00 00</span>  @...Œ...Ð...`‰..


{| class="wikitable"
{| class="wikitable"
Line 362: Line 416:
| empty || 0x2C || 0x04 || {{cellcolors|#ffeebb}} 00 00 00 00 || Not used
| empty || 0x2C || 0x04 || {{cellcolors|#ffeebb}} 00 00 00 00 || Not used
|-
|-
| Styles ID Integer Table Offset || 0x30 || 0x04 || {{cellcolors|#ffee99}} 00 00 18 D0* ||  
| Hash ID Integer Table Offset || 0x30 || 0x04 || {{cellcolors|#ffee99}} 00 00 18 D0* ||  
|-
|-
| Styles ID Integer Table Size || 0x34 || 0x04 || {{cellcolors|#ffee99}} 00 00 00 34* ||
| Hash ID Integer Table Size || 0x34 || 0x04 || {{cellcolors|#ffee99}} 00 00 00 34* ||
|-
|-
| Integer Array Table Offset || 0x38 || 0x04 || {{cellcolors|#ffee77}} 00 00 19 10* ||  
| Integer Array Table Offset || 0x38 || 0x04 || {{cellcolors|#ffee77}} 00 00 19 10* ||  
Line 379: Line 433:
|-
|-
|}
|}
====Vita RCSF====
'''Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F'''
'''00000000'''  <span style="background:#666666;">52 43 53 46</span>  <span style="background:#666666;">10 01 00 00</span>  <span style="background:#ff8888;">50 00 00 00</span>  <span style="background:#ff8888;">8C AD 00 00</span>  RCSF....P...Œ­­-..
'''00000010'''  <span style="background:#8888ff;">E0 AD 00 00</span>  <span style="background:#8888ff;">00 00 00 00</span>  <span style="background:#88ff88;">E0 AD 00 00</span>  <span style="background:#88ff88;">40 3C 00 00</span>  à­-..@<....ê.....
'''00000020'''  <span style="background:#ffeedd;">20 EA 00 00</span>  <span style="background:#ffeedd;">18 00 00 00</span>  <span style="background:#ffeebb;">40 EA 00 00</span>  <span style="background:#ffeebb;">B2 36 00 00</span>  .ê......@ê..²6..
'''00000030'''  <span style="background:#ffee99;">00 21 01 00</span>  <span style="background:#ffee99;">00 00 00 00</span>  <span style="background:#ffee77;">00 21 01 00</span>  <span style="background:#ffee77;">00 00 00 00</span>  .!......!.......
'''00000040'''  <span style="background:#ffee55;">00 21 01 00</span>  <span style="background:#ffee55;">00 00 00 00</span>  <span style="background:#ffee33;">00 21 01 00</span>  <span style="background:#ffee33;">00 00 00 00</span>  .!......!.......
{| class="wikitable"
|-
! Name !! Offset !! Size !! Example !! Remark
|-
| Magic || 0x00 || 0x04 || {{cellcolors|#666666|#ffffff}} 52 43 53 46 || 'RCSF'
|-
| Version || 0x04 || 0x04 || {{cellcolors|#666666|#ffffff}} 00 00 01 10* || CXML version '1.10'
|-
| Tree Table Offset || 0x08 || 0x04 || {{cellcolors|#ff8888}} 00 00 00 50* ||
|-
| Tree Table Size || 0x0C || 0x04 || {{cellcolors|#ff8888}} 00 00 AD 8C* ||
|-
| Overlapped || 0x18 || 0x04 || {{cellcolors|#8888ff}} 00 00 AD E0* || overlapped
|-
| empty || 0x1C || 0x04 || {{cellcolors|#8888ff}} 00 00 00 00* || not used
|-
| ID Integer Table Offset || 0x10 || 0x04 || {{cellcolors|#88ff88}} 00 00 AD E0* ||
|-
| ID Integer Table Size || 0x14 || 0x04 || {{cellcolors|#88ff88}} 00 00 3C 40* ||
|-
| String Table Offset || 0x20 || 0x04 || {{cellcolors|#ffeedd}} 00 00 EA 20* ||
|-
| String Table size || 0x24 || 0x04 || {{cellcolors|#ffeedd}} 00 00 00 18* ||
|-
| Char Table Offset || 0x28 || 0x04 || {{cellcolors|#ffeebb}} 00 00 EA 40* ||
|-
| Char Table Size || 0x2C || 0x04 || {{cellcolors|#ffeebb}} 00 00 36 B2 ||
|-
| End offset || 0x30 || 0x04 || {{cellcolors|#ffee99}} 00 01 21 00* || End offset
|-
| empty || 0x34 || 0x04 || {{cellcolors|#ffee99}} 00 00 00 00* || not used
|-
| overlapped || 0x38 || 0x04 || {{cellcolors|#ffee77}} 00 01 21 00* || overlapped
|-
| empty || 0x3C || 0x04 || {{cellcolors|#ffee77}} 00 00 00 00* || not used
|-
| overlapped || 0x38 || 0x04 || {{cellcolors|#ffee55}} 00 01 21 00* || overlapped
|-
| empty || 0x3C || 0x04 || {{cellcolors|#ffee55}} 00 00 00 00* || not used
|-
| overlapped || 0x38 || 0x04 || {{cellcolors|#ffee33}} 00 01 21 00* || overlapped
|-
| empty || 0x3C || 0x04 || {{cellcolors|#ffee33}} 00 00 00 00* || not used
|-
|}
  * reversed little endian
  * reversed little endian
*Notes
*Notes
**The sizes doesn't includes the (possible) padding at the end of all tables
**The sizes doesn't includes the (possible) padding at the end of all tables


===Tree Table===
===Tree Table===
Line 395: Line 503:
| 0x08 || 0x04 || FF FF FF FF  || Parent
| 0x08 || 0x04 || FF FF FF FF  || Parent
|-
|-
| 0x0C || 0x04 || FF FF FF FF || Previous Brother
| 0x0C || 0x04 || FF FF FF FF || Previous Sibling
|-
|-
| 0x10 || 0x04 || FF FF FF FF || Next Brother
| 0x10 || 0x04 || FF FF FF FF || Next Sibling
|-
|-
| 0x14 || 0x04 || 00 00 00 3C || First Child within the root Element <resource> (which will also our Next '''Child Element''' to read)
| 0x14 || 0x04 || 00 00 00 3C || First Child within the root Element <resource> (which will also our Next '''Child Element''' to read)
Line 425: Line 533:
| 0x44 || 0x04 || 00 00 00 00 || Parent (Offset within XML Table, pointing to Root Element)
| 0x44 || 0x04 || 00 00 00 00 || Parent (Offset within XML Table, pointing to Root Element)
|-
|-
| 0x48 || 0x04 || FF FF FF FF || Previous Brother
| 0x48 || 0x04 || FF FF FF FF || Previous Sibling
|-
|-
| 0x4C || 0x04 || 00 00 07 88 || Next Brother
| 0x4C || 0x04 || 00 00 07 88 || Next Sibling
|-
|-
| 0x50 || 0x04 || 00 00 00 58 || First Child
| 0x50 || 0x04 || 00 00 00 58 || First Child
Line 439: Line 547:
| 0x60 || 0x04 || 00 00 00 3C || Parrent <stringtable>
| 0x60 || 0x04 || 00 00 00 3C || Parrent <stringtable>
|-
|-
| 0x64 || 0x04 || FF FF FF FF || Previous Brother
| 0x64 || 0x04 || FF FF FF FF || Previous Sibling
|-
|-
| 0x68 || 0x04 || 00 00 00 B4 || Next Brother
| 0x68 || 0x04 || 00 00 00 B4 || Next Sibling
|-
|-
| 0x6C || 0x04 || FF FF FF FF || First Child
| 0x6C || 0x04 || FF FF FF FF || First Child
Line 498: Line 606:




====String Table====
===String Table===
from [http://www.file-upload.net/download-9994498/string_table.rar.html notification_settings_plugin.rco] FW??
from [http://www.file-upload.net/download-9994498/string_table.rar.html notification_settings_plugin.rco] FW??
This area is composed by a consecutive list of all the tags (elements or attributes) from the xml that was used to create the container. Are stored "from-top-to-bottom" in the exact same order that they was ordered in the xml (althougth it looks in some cases the theme compiler reorders them to his convenience). This list doesn't makes differences of the "directory hierarchy" of the tags neither is specified if the tag is an element or an attribute (this parent-child hierarchy is defined in other place of the container by making references to this area by using "byte counters" to locate a tag)
This area is composed by a consecutive list of all the tags (elements or attributes) from the xml that was used to create the container. Are stored "from-top-to-bottom" in the exact same order that they was ordered in the xml (althougth it looks in some cases the theme compiler reorders them to his convenience). This list doesn't makes differences of the "directory hierarchy" of the tags neither is specified if the tag is an element or an attribute (this parent-child hierarchy is defined in other place of the container by making references to this area by using "byte counters" to locate a tag)
Line 541: Line 649:
**The integer values and text strings of some attributes tags from the xml (e.g: "themename=mytheme", or "fontcolor=2") are stored in this area too at the right of his tag, the presence of an integer value displaces the next tag (this only happens in themes and rafs, not in QRC, RCO files so is added here as a note but is very important for the structure of the other containers when using "byte counters" to locate the tags)
**The integer values and text strings of some attributes tags from the xml (e.g: "themename=mytheme", or "fontcolor=2") are stored in this area too at the right of his tag, the presence of an integer value displaces the next tag (this only happens in themes and rafs, not in QRC, RCO files so is added here as a note but is very important for the structure of the other containers when using "byte counters" to locate the tags)


===ID Table===
===Char Table===
Need To write....
 
===ID Tables===
In a '''Vita RCO''' we have '''3''' diffrent '''ID Tables''' which we will take a deeper look now.  
In a '''Vita RCO''' we have '''3''' diffrent '''ID Tables''' which we will take a deeper look now.  


Line 589: Line 700:
  '''00000090'''  FF FF FF FF  <span style="background:#ffff66;">20 41 32 74</span>                            ÿÿÿÿ.A2t
  '''00000090'''  FF FF FF FF  <span style="background:#ffff66;">20 41 32 74</span>                            ÿÿÿÿ.A2t


====ID Style====
====ID Hash====
from [http://www.file-upload.net/download-9994521/id_styletable.rar.html notification_settings_plugin.rco] FW??
from [http://www.file-upload.net/download-9994521/id_styletable.rar.html notification_settings_plugin.rco] FW??


Line 601: Line 712:
  '''00000020'''  <span style="background:#ffff66;">DA 39 A3 EE  20 2F 57 0C  86 D6 DE 69  22 43 90 D9</span>  Ú9£î./W.†ÖÞi"C.Ù
  '''00000020'''  <span style="background:#ffff66;">DA 39 A3 EE  20 2F 57 0C  86 D6 DE 69  22 43 90 D9</span>  Ú9£î./W.†ÖÞi"C.Ù
  '''00000030'''  <span style="background:#ffff66;">DD 31 50 3B</span>                                        Ý1P;
  '''00000030'''  <span style="background:#ffff66;">DD 31 50 3B</span>                                        Ý1P;


===Integer Array===
===Integer Array===
Line 746: Line 856:


===XML Output===
===XML Output===
This is the Output, saved as xml, from the notification_settings_plugin.rco
This is the Output, saved as xml, from the notification_settings_plugin.rco on 3.60 DevKit Firmware


download [http://www.file-upload.net/download-9995156/notification_settings_plugin.rar.html notification_settings_plugin.xml] from FW??
    <?xml version="1.0" encoding="utf-8"?>
*Note: That xml below isn't perfect right now. Especially the values from <styletable> need to be corrected. I'll change the xml here as soon i finished the CXML Tool and got a nice correct xml written out.
    <resource version="0.100000001490116f" type="normal">
      <stringtable>
        <locale origsize="1120" src="files\original\ja.z" compress="on" id="ja" />
        <locale origsize="1344" src="files\original\en-gb.z" compress="on" id="en-gb" />
        <locale origsize="1344" src="files\original\en.z" compress="on" id="en" />
        <locale origsize="1424" src="files\original\fr.z" compress="on" id="fr" />
        <locale origsize="1488" src="files\original\es.z" compress="on" id="es" />
        <locale origsize="1392" src="files\original\de.z" compress="on" id="de" />
        <locale origsize="1376" src="files\original\it.z" compress="on" id="it" />
        <locale origsize="1392" src="files\original\nl.z" compress="on" id="nl" />
        <locale origsize="1408" src="files\original\pt-br.z" compress="on" id="pt-br" />
        <locale origsize="1392" src="files\original\pt.z" compress="on" id="pt" />
        <locale origsize="1408" src="files\original\ru.z" compress="on" id="ru" />
        <locale origsize="1120" src="files\original\ko.z" compress="on" id="ko" />
        <locale origsize="1072" src="files\original\zh-t.z" compress="on" id="zh-t" />
        <locale origsize="1072" src="files\original\zh-s.z" compress="on" id="zh-s" />
        <locale origsize="1360" src="files\original\fi.z" compress="on" id="fi" />
        <locale origsize="1328" src="files\original\sv.z" compress="on" id="sv" />
        <locale origsize="1328" src="files\original\da.z" compress="on" id="da" />
        <locale origsize="1328" src="files\original\no.z" compress="on" id="no" />
        <locale origsize="1392" src="files\original\pl.z" compress="on" id="pl" />
        <locale origsize="1392" src="files\original\tr.z" compress="on" id="tr" />
      </stringtable>
      <texturetable>
        <texture origsize="5328" src="files\original\1DDD0E08.z" compress="on" id="1DDD0E08" type="texture/gim" />
        <texture origsize="7632" src="files\original\2133CEEB.z" compress="on" id="2133CEEB" type="texture/gim" />
        <texture origsize="7632" src="files\original\F7988312.z" compress="on" id="F7988312" type="texture/gim" />
        <texture origsize="5328" src="files\original\6F57E251.z" compress="on" id="6F57E251" type="texture/gim" />
        <texture origsize="7632" src="files\original\86645D41.z" compress="on" id="86645D41" type="texture/gim" />
        <texture origsize="7632" src="files\original\100DEBD1.z" compress="on" id="100DEBD1" type="texture/gim" />
        <texture src="files\original\29B91F26.z" origsize="57648" div_ratio_h="[0.490000009536743f]" compress="on" margin_v="[1]" id="29B91F26" margin_h="[1]" type="texture/gim" div_mode="3x1" />
        <texture src="files\original\D0A272A1.z" origsize="57648" div_ratio_h="[0.490000009536743f]" compress="on" margin_v="[1]" id="D0A272A1" margin_h="[1]" type="texture/gim" div_mode="3x1" />
      </texturetable>
      <styletable>
        <style_button id="2F652005" bg_obj="9C96918B" glow_obj="22FF88BD">
          <planeobj texture0="29B91F26" id="9C96918B" />
          <planeobj texture0="D0A272A1" blend="2" id="22FF88BD" />
        </style_button>
        <style_text textobj="01F875B1" id="3C288EE9">
          <textobj font_size="28f" bold="1" color="[1f, 1f, 1f, 1f]" max_line_count="2" line_pitch="28f" word_wrap="1" ellipsis="1" id="01F875B1" />
        </style_text>
        <style_plane id="C72CF1D7" planeobj="E95F1628">
          <planeobj texture0="1845D10D" id="E95F1628" />
        </style_plane>
      </styletable>
      <pagetable />
      <templatetable>
        <template id="3F187491">
          <file_list style="7038364B" id="38B62BE4">
            <layout_hint align="[0, 0]" size="[960f, 448f]" id="0A2F2CD9" pos="[0f, 0f]" />
          </file_list>
        </template>
        <template fast_open="1" id="AF37FB60">
          <list_item style="F3488F99" id="63678FEE">
            <layout_hint align="[0, 0]" size="[840f, 80f]" id="0A2F2CD9" pos="[0f, 0f]" />
            <text style="3C288EE9" id="2FBCDEAE">
              <layout_hint size="[462f, 0f]" align="[1, 4]" adjust="[0, 2]" id="DA39A3EE" pos="[-272f, 0f]" />
              <plane style="5F7B332B" id="202F570C">
                <layout_hint pos="[-30f, 0f]" id="DA39A3EE" adjust="[0, 0]" alpha="0f" anchor="[1, 5]" size="[60f, 60f]" />
              </plane>
              <check_box style="9F20F898" id="86D6DE69">
                <layout_hint align="[2, 0]" size="[46f, 46f]" pos="[602f, 0f]" anchor="[1, 5]" id="DA39A3EE" />
                <focus_hint focus_shape="0" focus_size="[47f, 47f]" />
              </check_box>
            </text>
          </list_item>
        </template>
        <template fast_open="1" id="E80C8623">
          <list_item style="F3488F99" id="63678FEE">
            <layout_hint align="[0, 0]" size="[840f, 80f]" id="0A2F2CD9" pos="[0f, 0f]" />
            <button sound="20413274" style="2F652005" id="224390D9">
              <layout_hint size="[840f, 80f]" adjust="[0, 0]" id="DA39A3EE" pos="[0f, 0f]" />
              <focus_hint focus_shape="3" focus_size="[960f, 80f]" />
              <text style="3C288EE9" id="2FBCDEAE">
                <layout_hint size="[398f, 0f]" align="[1, 4]" adjust="[0, 2]" id="DA39A3EE" pos="[-206f, 0f]" />
                <plane style="5F7B332B" id="202F570C">
                  <layout_hint pos="[-40f, 0f]" id="DA39A3EE" adjust="[0, 0]" alpha="0f" anchor="[1, 5]" size="[60f, 60f]" />
                </plane>
              </text>
              <plane style="C72CF1D7" id="DD31503B">
                <layout_hint size="[46f, 46f]" align="[2, 0]" adjust="[0, 0]" id="DA39A3EE" pos="[330f, 0f]" />
              </plane>
            </button>
          </list_item>
        </template>
      </templatetable>
    </resource>


<?xml version="1.0" encoding="UTF-8"?>
== Other useful links ==
<resource version="0.1" type="normal">
  <stringtable>
    <local origsize="1040" src="xmls/ja.xml"    compress="on" id="ja"/>
    <local origsize="1248" src="xmls/en-gb.xml" compress="on" id="en-gb"/>
    <local origsize="1248" src="xmls/en.cml"    compress="on" id="en"/>
    <local origsize="1328" src="xmls/fr.xml"    compress="on" id="fr"/>
    <local origsize="1392" src="xmls/es.xml"    compress="on" id="es"/>
    <local origsize="1312" src="xmls/de.xml"    compress="on" id="de"/>
    <local origsize="1280" src="xmls/it.xml"    compress="on" id="it"/>
    <local origsize="1296" src="xmls/nl.xml"    compress="on" id="nl"/>
    <local origsize="1312" src="xmls/pt-br.xml" compress="on" id="pt-br"/>
    <local origsize="1296" src="xmls/pt.xml"    compress="on" id="pt"/>
    <local origsize="1312" src="xmls/ru.xml"    compress="on" id="ru"/>
    <local origsize="1040" src="xmls/ko.xml"    compress="on" id="ko"/>
    <local origsize="992"  src="xmls/zh-t.xml"  compress="on" id="zh-t"/>
    <local origsize="992"  src="xmls/zh-s.xml"  compress="on" id="zh-s"/>
    <local origsize="1264" src="xmls/fi.xml"    compress="on" id="fi"/>
    <local origsize="1232" src="xmls/sv.xml"    compress="on" id="sv"/>
    <local origsize="1232" src="xmls/da.xml"    compress="on" id="da"/>
    <local origsize="1232" src="xmls/no.xml"    compress="on" id="no"/>
    <local origsize="1296" src="xmls/pl.xml"    compress="on" id="pl"/>
    <local origsize="1296" src="xmls/tr.xml"    compress="on" id="tr"/>
  </stringtable>
  <texturetable>
    <texture origsize="5328" src="texture/1DDD0E08.gim"  compress="on" id="1DDD0E08"  type="texture/gim"/>
    <texture origsize="7632" src="texture/2133CEEB.gim"  compress="on" id="2133CEEB"  type="texture/gim"/>
    <texture origsize="7632" src="texture/F7988312.gim" compress="on" id="F7988312" type="texture/gim"/>
    <texture origsize="5328" src="texture/6F57E251.gim" compress="on" id="6F57E251" type="texture/gim"/>
    <texture origsize="7632" src="texture/86645D41.gim" compress="on" id="86645D41" type="texture/gim"/>
    <texture src="texture/29B91F26.gim"  origsize="57648" div_ratio_h="0.49" compress="on" margin_v="1" id="29B91F26"  margin_h="1" type="texture/gim" div_mode="3x1"/>
    <texture src="texture/D0A272A1.gim" origsize="57648" div_ratio_h="0.49" compress="on" margin_v="1" id="D0A272A1" margin_h="1" type="texture/gim" div_mode="3x1"/>
  </texturetable>
  <styletable>
    <style_button id="86009135" bg_obj="1, 0, 0, 0" glow_obj="0, 0, 0, 0">
        <planeobj texture0="261FB929" id="01000000"/>
        <planeobj texture0="A172A2D0" blend="2" id="00000000" />
        <style_text textobj="00000000" id="E98E283C"/>
            <textobj font_size="28" bold="1" color="0.49, 1, 1, 1" max_line_count="1" line_pitch="28" word_wrap="1" ellipsis="1" id="00000000"/>
        </style_text>
    </style_button>
    <style_plane id="D7F12CC7" planeobj="0, 0, 0, 0">
        <planeobj texture0="0DD14518" id="01000000"/>
    </style_plane>
    <pagetable>
        <templatetable>
            <template id="9174183F">
                <file_list style="4B363870" id="04000000"/>
                <layout_hint align="0, 0" size="960, 448" id="00000000" pos="0, 0"/>
            </template>
            <template fast_open="1" id="60FB37AF">
                <list_item style="998F48F3" id="02000000">
                    <layout_hint align="0, 0" size="840, 80" id="00000000" pos="448, 0"/>
                    <text style="E98E283C" id="01000000">
                        <layout_hint size="462, 0" align="1, 0" adjust="0, 0" id="05000000" pos="-272, 0"/>
                        <plane style="2B337B5F" id="02000000">
                            <layout_hint pos="-30, 0" id="05000000" adjust="0, 0" alpha="0" anchor="1, 0" size="60, 60"/>
                        </plane>
                        <check_box style="98F8209F" id="00000000">
                            <layout_hint align="2, 0" size="46, 46" pos="602, 0" anchor="1, 0" id="05000000"/>
                            <focus_hint focus_shape="0" focus_size="47, 47"/>
                        </check_box>
                    </text>
                </list_item>
            </template>
            <template fast_open="1" id="23860CE8">
                <list_item style="998F48F3" id="02000000">
                    <layout_hint align="0, 0" size="840, 80" id="00000000" pos="0, 0"/>
                    <button sound="74324120" style="0520652F" id="00000000">
                        <layout_hint size="840, 80" adjust="1, 0" id="01000000" pos="0, 0"/>
                        <focus_hint focus_shape="3" focus_hint="960, 80"/>
                        <text style="E98E283C" id="02000000">
                            <layout_hint size="-206, 0" align="0, 0" adjust="4, 0" id="01000000" pos="0, 330"/>
                            <file_list style="2B337B5F" id="05000000">
                                <layout_hint pos="0, -40" id="01000000" adjust="1, 0" alpha="0" anchor="2, 0" size="60, 60"/>
                            </file_list>
                        </text>
                        <plane style="D7F12CC7" id="D9904322">
                            <layout_hint size="46, 46" align="5, 2" adjust="1, 0" id="EEA339DA" pos="330, 0"/>
                        </plane>
                    </button>
                </list_item>
            </template>
        </templatetable>
    </pagetable>
  </styletable>
</resource>
</xml>


==Other Usefull Links==
So what of old but still handy [https://github.com/ColdSauce/psxsdk/tree/master/tools VAG2WAV WAV2VAG Source]
So what of old but still handy [http://psxsdk.googlecode.com/svn/!svn/bc/13/trunk/tools/ VAG2WAV WAV2VAG Source]

Revision as of 03:49, 24 August 2021


RCO

  • In PSvita the RCO's uses a cxml structure, with a header size of 0x50 and the magic identifyer RCOF
    • RCOF header is 0x10 bytes bigger than any cxml header in PS3 (this means there are 2 new tables added for the new cxml variant used in vita rco's). And endianess changed
    • Some of the extracted files (after cropped and zlib decompressed) are another variant of a cxml structure with identifyer RCSF. After a second extraction (with a cxml decompiler tool) the resulting file is a .xml containing only text strings (this double cxml method is used for .xml files that stores language translations)

Simply Vita RCO Extractor

Some RCO as Reference

CXML Decompiler and Compiler

There is also a cxml compiler labled "cxml.py" inside the PSM SDK @ %SCE_PSM_SDK%\tools\PublishingUtility\cxml\compiler as this is the format of app.info

notification_settings_plugin.rco (PSvita)
Offset Size Example Name Notes
CXML Header
0x00 0x04 RCOF Magic
0x04 0x04 10 01 00 00 Version
0x08 0x04 50 00 00 00 Tree absolute start offset, also header size in PS3 = Tree absolute start offset
0x0C 0x04 2C 15 00 00 Tree size in PS3 = Tree size
0x10 0x04 80 15 00 00 ID STR table absolute start offset in PS3 = ID table absolute start offset
0x14 0x04 B0 00 00 00 ID STR table size in PS3 = ID table size
0x18 0x04 30 16 00 00 ID INT table absolute start offset in PS3 = Strings table absolute start offset
0x1C 0x04 98 00 00 00 ID INT table size in PS3 = Strings table size
0x20 0x04 D0 16 00 00 Strings table absolute start offset in PS3 = Integer array absolute start offset
0x24 0x04 F1 01 00 00 Strings table size in PS3 = Integer array size
0x28 0x04 D0 18 00 00 Char table absolute start offset in PS3 = Float array absolute start offset
0x2C 0x04 00 00 00 00 Char table size in PS3 = Float array size
0x30 0x04 D0 18 00 00 Hash ID INT table absolute start offset in PS3 = File table absolute start offset
0x34 0x04 34 00 00 00 Hash ID INT table size in PS3 = File table size
0x38 0x04 10 19 00 00 Integer array absolute start offset in PS3 = Unknown area absolute start offset
0x3C 0x04 2C 00 00 00 Integer array size in PS3 = Unknown area size
0x40 0x04 40 19 00 00 Float array absolute start offset in PS3 = Not present
0x44 0x04 8C 00 00 00 Float array size in PS3 = Not present
0x48 0x04 D0 19 00 00 File table absolute start offset in PS3 = Not present
0x4C 0x04 60 89 00 00 File table size in PS3 = Not present
Tables
0x50 Tree starts here

XML implicit structure Overview

namespace cxml {
    class cxml : public Base {
        struct Header { /*header of a cxml document*/
            char magic[4];
            int version;
            int tree_offset;
            int tree_size;
            int idstrtable_offset;
            int idstrtable_size;
            int idinttable_offset;
            int idinttable_size;
            int stringtable_offset;
            int stringtable_size;
            int chartable_offset;
            int chartable_size;
            int hashidtable_offset;
            int hashidtable_size;
            int intarraytable_offset;
            int intarraytable_size;
            int floatarraytable_offset;
            int floatarraytable_size;
            int filetable_offset;
            int filetable_size;
        };
       
        struct ChildElementBin {
            int name;
            int attr_num;
            int parent_node;
            int prev_sibling;
            int next_sibling;
            int first_child;
            int last_child;
            AttributeBin attribute;
        };
       
        struct SiblingElementBin {
            int name;
            int attr_num;
            int parent_node;
            int prev_sibling;
            int next_sibling;
            AttributeBin attribute;
        };
       
        struct AttributeBin {
            typedef enum {
                NONE,
                INTEGER,
                FLOAT,
                STRING,
                CHAR,
                HASH_ID,
                INTEGER_ARRAY,
                FLOAT_ARRAY,
                DATA,
                ID_STR_LPB,
                ID_STR,
                ID_INT_LPB,
                ID_INT,
            } TYPE;

            int name;
            TYPE type;

            struct SingleValue {
                int intValue;
                float floatValue;       
            };

            struct StringData {
                int offset;
                int len;
            };

            struct CharData {
                int offset;
                int len;
            };
               
            struct IntArrayData {
                int offset;
                int num;
            };
               
            struct FloatArrayData {
                int offset;
                int num;
            };
              
            struct FileData {
                int offset;
                int size;
            };

            struct IdStringTableData {
                int offset;
                bool loopback;
            };

            struct IdIntegerTableData {
                int offset;
                bool loopback;
            };
               
            union {
                int i;
                float f;
                StringData s;
                CharData c;
                IntArrayData ia;
                FloatArrayData fa;
                FileData file;
                int id;
                int idref;
            };
        };
       
        struct IDBin {
            int entity_offset;
            char id[0];
        };
       
        enum AllocationType {
            AllocationType_Alloc_Tree,
            AllocationType_Alloc_IDSTRTable,
            AllocationType_Alloc_IDINTTable,
            AllocationType_Alloc_StringTable,
            AllocationType_Alloc_CharTable,
            AllocationType_Alloc_IntArrayTable,
            AllocationType_Alloc_FloatArrayTable,
            AllocationType_Alloc_FileTable,
            AllocationType_Alloc_HashIDTable,
 
            AllocationType_Free_Tree,
            AllocationType_Free_IDSTRTable,
            AllocationType_Free_IDINTTable,
            AllocationType_Free_StringTable,
            AllocationType_Free_CharTable,
            AllocationType_Free_IntArrayTable,
            AllocationType_Free_FloatArrayTable,
            AllocationType_Free_FileTable,
            AllocationType_AFree_HashIDTable,
        };
      
        enum AccessMode {
            AccessMode_ReadWrite,
            AccessMode_ReadOnly_File,
            AccessMode_ReadOnly_Memory,
        };
       
        class Document {
        public:
            typedef void (*Allocator)( AllocationType type, void * userdata, void * old_addr, unsigned int required_size, void ** addr, unsigned int * size );
       
        private:
            AccessMode access_mode;
            Header header;
            char *tree;
            unsigned int tree_capacity;
            char *idstrtable;
            unsigned int idstrtable_capacity;
            char *idinttable;
            unsigned int idinttable_capacity;
            char *stringtable;
            unsigned int stringtable_capacity;
            char *chartable;
            unsigned int chartable_capacity;
            int *intarraytable;
            unsigned int intarraytable_capacity;
            float *floatarraytable;
            unsigned int floatarraytable_capacity;
            char *filetable;
            unsigned int filetable_capacity;
            char *hashidtable;
            unsigned int hashidtable_capacity;
            Allocator allocator;
            void *allocator_userdata;
        };
       
        class Element {
        private:
            Document *doc;
            int offset;
        };
      
        class Attribute {
        private:
            Document *doc;
            int element_offset;
            int offset;
        };

        /// <summary>
        /// Initializes this class. Some times also called Constructore.
        /// </summary>
        void Initialize() {
            // All stuff that need to be set before running any function call...
            // goes into here.
        };
    };
};

Element

CXML Child Element definition
Offset Length usage
0x00 0x04 Element name relative offset in TAGS Table
0x04 0x04 Number of attributes in TOC
0x08 0x04 Parent relative offset in TOC
0x0C 0x04 Previous Sibling relative offset in TOC
0x10 0x04 Next Sibling relative offset in TOC
0x14 0x04 First child relative offset in TOC
0x18 0x04 Last child relative offset in TOC

Length is 7 x 4 bytes == 28 bytes (0x1C).


CXML Sibling Element definition
Offset Length usage
0x00 0x04 Element name relative offset in TAGS Table
0x04 0x04 Number of attributes in TOC
0x08 0x04 Parent relative offset in TOC
0x0C 0x04 Previous Sibling relative offset in TOC
0x10 0x04 Next Sibling relative offset in TOC

Length is 5 x 4 bytes == 20 bytes (0x14).

NOTE:

  • The Child Element defination describe the Child Element without his Attributes where the Sibling Element describe the Sibling Element also without his Attributes.
  • So the full order to read will be Child Element >>> Attributes, Sibling Element >>> Attributes. The Root (so offset 0x00) of any SonyPlaystation Resource file always start's with a Child element to read.

Attribute

Length is 4 x 4 bytes == 16 bytes (0x10).

CXML Attribute definitions
Attribute name
(offset 0x0, length 0x4)
Attribute name relative offset in TAGS Table
Attribute type
(offset 0x4, length 0x4)
1
(Single Integer)
2
(Single Float)
3
(String)
4
(Char)
5
(ID HASH)
6
(Integer Array)
7
(Float Array)
8
(File)
9
(ID STR w lpb Ref)
A
(ID STR wo lpb Ref)
B
(ID INT w lpb Ref)
C
(ID INT wo lpb Ref)
variable 1
(offset 0x8, length 0x4)
Integer value Float value Strings Table offset Chars Table offset ID HASH Table offset Integer Arrays Table offset Float Arrays Table offset Files Table offset ID STR Table offset ID STR Table offset ID INT Table offset ID INT Table offset
variable 2
(offset 0xC, length 0x4)
Not used (always 0) Not used (always 0) String length Char length int's to read (always 4) Nr. of int's to read Nr. of float's to read File size Not used (always 0) Not used (always 0) Not used (always 0) Not used (always 0)
* w = with || wo = without || lpb = loopback

Container Common Structure

RCO

ZLIB Compressed level 9 (only container)

RCOF / RCSF

RCOF (Resources Container Object File)
RCSF (Resources Container String File)

  • Example from FW?? notification_settings_plugin.rco:
Offset(h) 00 01 02 03  04 05 06 07
00000000  52 43 4F 46  10 01 00 00 RCOF....
Name Offset Size Example Remark
Magic 0x00 0x04 52 43 4F 46 'RCOF'
Version 0x04 0x04 00 00 01 10* CXML version '1.10'


Offset(h) 00 01 02 03  04 05 06 07
00000000  52 43 53 46  10 01 00 00 RCSF....
Name Offset Size Example Remark
Magic 0x00 0x04 52 43 53 46 'RCSF'
Version 0x04 0x04 00 00 01 10* CXML version '1.10'
* reversed little endian


Zlib Header (source)
byte index bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
[0] CMF Compression info
  • 7 = indicates a 32K window size
Compression method
  • 8 = denotes the "deflate" compression
[1] FLG FLEVEL
  • 0 - compressor used fastest algorithm
  • 1 - compressor used fast algorithm
  • 2 - compressor used default algorithm
  • 3 - compressor used maximum compression, slowest algorithm
FDICT

(Preset dictionary)

If set, a DICT dictionary identifier is present
immediately after the FLG byte. The dictionary is a sequence of
bytes which are initially fed to the compressor without
producing any compressed output. DICT is the Adler-32 checksum
of this sequence of bytes (see the definition of ADLER32
below).  The decompressor can use this identifier to determine
which dictionary has been used by the compressor.
FCHECK
value must be such that CMF and FLG, when viewed as
a 16-bit unsigned integer stored in MSB order (CMF *256 + FLG),
is a multiple of 31.


About Data Compression:

Main Header

The header contains an identifier of the container (magic), his version, and allows to store the "absolute start offset" and "size" of 9 tables (or areas)

When a "not used table" is placed before a "used table"... the start offset of the "not used table" and his size (as zero) are stored in the main header to preserve his position in the structure. The "used table" that comes later starts in the same offset than the previously "not used table" (an intuitive way to think in this is imagining are overlapped because starts in the same position but only the one at the top is used)

  • The container format is generic (used also by PS3 files like .RAF, .QRC and .P3T with some variations) so the usage of this tables can vary, in this example there is 1 "not used table":
    • one of the "not used table" (at offset 0x18D0 with a size of 0) is placed before an used table (also at offset 0x18D0 but with a size of 0x34)

RCOF

Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F
00000000  52 43 4F 46  10 01 00 00  50 00 00 00  2C 15 00 00  RCOF....P...,...
00000010  80 15 00 00  B0 00 00 00  30 16 00 00  98 00 00 00  €...°...0...˜...
00000020  D0 16 00 00  F1 01 00 00  D0 18 00 00  00 00 00 00  Ð...ñ...Ð.......
00000030  D0 18 00 00  34 00 00 00  10 19 00 00  2C 00 00 00  Ð...4.......,...
00000040  40 19 00 00  8C 00 00 00  D0 19 00 00  60 89 00 00  @...Œ...Ð...`‰..
Name Offset Size Example Remark
Magic 0x00 0x04 52 43 4F 46 'RCOF'
Version 0x04 0x04 00 00 01 10* CXML version '1.10'
Tree Table Offset 0x08 0x04 00 00 00 50*
Tree Table Size 0x0C 0x04 00 00 15 2C*
ID String Table Offset 0x10 0x04 00 00 15 80*
ID String Table Size 0x14 0x04 00 00 00 B0*
ID Integer Table Offset 0x18 0x04 00 00 16 30*
ID Integer Table Size 0x1C 0x04 00 00 00 98*
String Table Offset 0x20 0x04 00 00 16 D0*
String Table size 0x24 0x04 00 00 01 F1*
overlapped 0x28 0x04 00 00 18 D0* Overlapped
empty 0x2C 0x04 00 00 00 00 Not used
Hash ID Integer Table Offset 0x30 0x04 00 00 18 D0*
Hash ID Integer Table Size 0x34 0x04 00 00 00 34*
Integer Array Table Offset 0x38 0x04 00 00 19 10*
Integer Array Table Size 0x3C 0x04 00 00 00 2C*
Float Array Table Offset 0x38 0x04 00 00 19 40*
Float Array Table Size 0x3C 0x04 00 00 00 8C*
File Table Offset 0x38 0x04 00 00 19 D0*
File Table Size 0x3C 0x04 00 00 89 60*

Vita RCSF

Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F
00000000  52 43 53 46  10 01 00 00  50 00 00 00  8C AD 00 00  RCSF....P...Œ­­-..
00000010  E0 AD 00 00  00 00 00 00  E0 AD 00 00  40 3C 00 00  à­-..@<....ê.....
00000020  20 EA 00 00  18 00 00 00  40 EA 00 00  B2 36 00 00  .ê......@ê..²6..
00000030  00 21 01 00  00 00 00 00  00 21 01 00  00 00 00 00  .!......!.......
00000040  00 21 01 00  00 00 00 00  00 21 01 00  00 00 00 00  .!......!.......
Name Offset Size Example Remark
Magic 0x00 0x04 52 43 53 46 'RCSF'
Version 0x04 0x04 00 00 01 10* CXML version '1.10'
Tree Table Offset 0x08 0x04 00 00 00 50*
Tree Table Size 0x0C 0x04 00 00 AD 8C*
Overlapped 0x18 0x04 00 00 AD E0* overlapped
empty 0x1C 0x04 00 00 00 00* not used
ID Integer Table Offset 0x10 0x04 00 00 AD E0*
ID Integer Table Size 0x14 0x04 00 00 3C 40*
String Table Offset 0x20 0x04 00 00 EA 20*
String Table size 0x24 0x04 00 00 00 18*
Char Table Offset 0x28 0x04 00 00 EA 40*
Char Table Size 0x2C 0x04 00 00 36 B2
End offset 0x30 0x04 00 01 21 00* End offset
empty 0x34 0x04 00 00 00 00* not used
overlapped 0x38 0x04 00 01 21 00* overlapped
empty 0x3C 0x04 00 00 00 00* not used
overlapped 0x38 0x04 00 01 21 00* overlapped
empty 0x3C 0x04 00 00 00 00* not used
overlapped 0x38 0x04 00 01 21 00* overlapped
empty 0x3C 0x04 00 00 00 00* not used
* reversed little endian
  • Notes
    • The sizes doesn't includes the (possible) padding at the end of all tables

Tree Table

from notification_settings_plugin.rco FW??

Offset Size Example Remark
0x00 0x04 00 00 00 00 Root Element (Offset within String Table, in this case it will be <resource>)
0x04 0x04 00 00 00 02 Attribute Counter
0x08 0x04 FF FF FF FF Parent
0x0C 0x04 FF FF FF FF Previous Sibling
0x10 0x04 FF FF FF FF Next Sibling
0x14 0x04 00 00 00 3C First Child within the root Element <resource> (which will also our Next Child Element to read)
0x18 0x04 00 00 0D 74 Last Child within the root Element <resource> (which will also our Next Child Element to read)
0x1C 0x04 00 00 00 09 String Pointer (Offset within String Table, in this case it will be "version")
0x20 0x04 00 00 00 02 Type descriptor (2 == Float)
0x24 0x04 3D CC CC CD Float value (0.1) [version="0.1"]
0x28 0x04 00 00 00 00 empty value
0x2C 0x04 00 00 00 11 String Pointer (in this case "type")
0x30 0x04 00 00 00 03 Type descriptor (3 == String)
0x34 0x04 00 00 00 16 Offset within String Table of String to read
0x38 0x04 00 00 00 06 Length of String to read (0x06 == "normal") [type="normal"]
0x3C 0x04 00 00 00 1D Next Element (Offset within String Table, in this case it will be <stringtable>)
0x40 0x04 00 00 00 00 Attribute Count
0x44 0x04 00 00 00 00 Parent (Offset within XML Table, pointing to Root Element)
0x48 0x04 FF FF FF FF Previous Sibling
0x4C 0x04 00 00 07 88 Next Sibling
0x50 0x04 00 00 00 58 First Child
0x54 0x04 00 00 07 2C Last Child
0x58 0x04 00 00 00 29 String Pointer (in this case <local>)
0x5C 0x04 00 00 00 04 Attribute Count
0x60 0x04 00 00 00 3C Parrent <stringtable>
0x64 0x04 FF FF FF FF Previous Sibling
0x68 0x04 00 00 00 B4 Next Sibling
0x6C 0x04 FF FF FF FF First Child
0x70 0x04 FF FF FF FF Last Child
0x74 0x04 00 00 00 30 String Pointer (in this case origsize="")
0x78 0x04 00 00 00 01 Attribute identifyer (in this case 1 so a integer value)
0x7C 0x04 00 00 04 10 Hex integer size (1040 bytes when converted so origsize="1045")
0x80 0x04 00 00 00 00 empty value
0x84 0x04 00 00 00 39 String Pointer (in this case src="")
0x88 0x04 00 00 00 08 Attribute identifyer (in this case 8 so a file)
0x8C 0x04 00 00 00 00 Offset within File Table
0x90 0x04 00 00 01 BA Size of file to read
0x94 0x04 00 00 00 3D String Pointer (in this case compress="")
0x98 0x04 00 00 00 03 Attribute identifyer (in this case 3 so a string)
0x9C 0x04 00 00 00 46 Offset of the string to read within String Table
0xA0 0x04 00 00 00 02 Size of the string to read (in this case will be 'on' so compress="on")
0xA4 0x04 00 00 00 49 String Pointer (in this case id="")
0xA8 0x04 00 00 00 09 Attribute identifyer (in this case 9 so a ID String with Loopback offset)
0xAC 0x04 00 00 00 00 Offset of the id to read within ID String Table (in this case 'ja' so id="ja" and after the loopback src="/xmls/ja.xml")
0xB0 0x04 00 00 00 00 empty value
  • Note: the folder string within the src="" Attribute is a custom one which need to be handled by the app or which is dependend to the developer who will write the CXML Tool (so me)
    • Note2: All values are reversed little endian
Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F
00000000  00 00 00 00  02 00 00 00  FF FF FF FF  FF FF FF FF  ........ÿÿÿÿÿÿÿÿ
00000010  FF FF FF FF  3C 00 00 00  74 0D 00 00  09 00 00 00  ÿÿÿÿ<...t.......
00000020  02 00 00 00  CD CC CC 3D  00 00 00 00  11 00 00 00  ....ÍÌÌ=........
00000030  03 00 00 00  16 00 00 00  06 00 00 00  1D 00 00 00  ................
00000040  00 00 00 00  00 00 00 00  FF FF FF FF  88 07 00 00  ........ÿÿÿÿˆ...
00000050  58 00 00 00  2C 07 00 00  29 00 00 00  04 00 00 00  X...,...).......
00000060  3C 00 00 00  FF FF FF FF  B4 00 00 00  FF FF FF FF  <...ÿÿÿÿ´...ÿÿÿÿ
00000070  FF FF FF FF  30 00 00 00  01 00 00 00  10 04 00 00  ÿÿÿÿ0...........
00000080  00 00 00 00  39 00 00 00  08 00 00 00  00 00 00 00  ....9...........
00000090  BA 01 00 00  3D 00 00 00  03 00 00 00  46 00 00 00  º...=.......F...
000000A0  02 00 00 00  49 00 00 00  09 00 00 00  00 00 00 00  ....I...........
000000B0  00 00 00 00                                         ....


String Table

from notification_settings_plugin.rco FW?? This area is composed by a consecutive list of all the tags (elements or attributes) from the xml that was used to create the container. Are stored "from-top-to-bottom" in the exact same order that they was ordered in the xml (althougth it looks in some cases the theme compiler reorders them to his convenience). This list doesn't makes differences of the "directory hierarchy" of the tags neither is specified if the tag is an element or an attribute (this parent-child hierarchy is defined in other place of the container by making references to this area by using "byte counters" to locate a tag)

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  72 65 73 6F 75 72 63 65 00 76 65 72 73 69 6F 6E  resource.version
00000010  00 74 79 70 65 00 6E 6F 72 6D 61 6C 00 73 74 72  .type.normal.str
00000020  69 6E 67 74 61 62 6C 65 00 6C 6F 63 61 6C 65 00  ingtable.locale.
00000030  6F 72 69 67 73 69 7A 65 00 73 72 63 00 63 6F 6D  origsize.src.com
00000040  70 72 65 73 73 00 6F 6E 00 69 64 00 74 65 78 74  press.on.id.text
00000050  75 72 65 74 61 62 6C 65 00 74 65 78 74 75 72 65  uretable.texture
00000060  00 74 65 78 74 75 72 65 2F 67 69 6D 00 64 69 76  .texture/gim.div
00000070  5F 72 61 74 69 6F 5F 68 00 6D 61 72 67 69 6E 5F  _ratio_h.margin_
00000080  76 00 6D 61 72 67 69 6E 5F 68 00 64 69 76 5F 6D  v.margin_h.div_m
00000090  6F 64 65 00 33 78 31 00 73 74 79 6C 65 74 61 62  ode.3x1.staletab
000000A0  6C 65 00 73 74 79 6C 65 5F 62 75 74 74 6F 6E 00  le.style_button.
000000B0  62 67 5F 6F 62 6A 00 67 6C 6F 77 5F 6F 62 6A 00  bg_ogj.glow_obj.
000000C0  70 6C 61 6E 65 6F 62 6A 00 74 65 78 74 75 72 65  planeobj.texture
000000D0  30 00 62 6C 65 6E 64 00 73 74 79 6C 65 5F 74 65  0.blend.style_te
000000E0  78 74 00 74 65 78 74 6F 62 6A 00 66 6F 6E 74 5F  xt.textobj.font_
000000F0  73 69 7A 65 00 62 6F 6C 64 00 63 6F 6C 6F 72 00  size.bold.color.
00000100  6D 61 78 5F 6C 69 6E 65 5F 63 6F 75 6E 74 00 6C  max_line_count.l
00000110  69 6E 65 5F 70 69 74 63 68 00 77 6F 72 64 5F 77  ine_pitch.word_w
00000120  72 61 70 00 65 6C 6C 69 70 73 69 73 00 73 74 79  rap.ellipsis.sty
00000130  6C 65 5F 70 6C 61 6E 65 00 70 61 67 65 74 61 62  le_plane.pagetab
00000140  6C 65 00 74 65 6D 70 6C 61 74 65 74 61 62 6C 65  le.templatetable
00000150  00 74 65 6D 70 6C 61 74 65 00 66 69 6C 65 5F 6C  .template.file_l
00000160  69 73 74 00 73 74 79 6C 65 00 6C 61 79 6F 75 74  ist.style.layout
00000170  5F 68 69 6E 74 00 61 6C 69 67 6E 00 73 69 7A 65  hint.align.size.
00000180  00 70 6F 73 00 66 61 73 74 5F 6F 70 65 6E 00 6C  .pos.fast_open.l
00000190  69 73 74 5F 69 74 65 6D 00 74 65 78 74 00 61 64  ist_item.text.ad
000001A0  6A 75 73 74 00 70 6C 61 6E 65 00 61 6C 70 68 61  just.plane.alpha
000001B0  00 61 6E 63 68 6F 72 00 63 68 65 63 6B 5F 62 6F  .anchor.check_bo
000001C0  78 00 66 6F 63 75 73 5F 68 69 6E 74 00 66 6F 63  x.focus_hint.foc
000001D0  75 73 5F 73 68 61 70 65 00 66 6F 63 75 73 5F 73  us_shape.focus_s
000001E0  69 7A 65 00 62 75 74 74 6F 6E 00 73 6F 75 6E 64  ize.button.sound
000001F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
  • Notes:
    • yellow: used bytes
    • red: padding to align to 0x10 bytes
    • The integer values and text strings of some attributes tags from the xml (e.g: "themename=mytheme", or "fontcolor=2") are stored in this area too at the right of his tag, the presence of an integer value displaces the next tag (this only happens in themes and rafs, not in QRC, RCO files so is added here as a note but is very important for the structure of the other containers when using "byte counters" to locate the tags)

Char Table

Need To write....

ID Tables

In a Vita RCO we have 3 diffrent ID Tables which we will take a deeper look now.

The loopback offset is market as red.

The id is marked as yellow.

  • Note: All loopback offset are reversed little endian.

ID String

from notification_settings_plugin.rco FW??

Is a Table that only hold Strings and will be readed till the first 0x00 byte and then stop. The first 4 bytes before the string are the loopback offset to add the id string to the src="" Attribute value.

  • Note: If all loopback offset's are used depends on the used Attribute identifyer (9-will use loopback- or A-will not use loopback-). But for string's they will always loopback
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  00 00 00 58 6A 61 00 00 00 00 00 B4 65 6E 2D 67  X...ja..´...en-g
00000010  62 00 00 00 00 00 01 10 65 6E 00 00 00 00 01 6C  b.......en..l...
00000020  66 72 00 00 00 00 01 C8 65 73 00 00 00 00 02 24  fr..È...es..$...
00000030  64 65 00 00 00 00 02 80 69 74 00 00 00 00 02 DC  de..€...it..Ü...
00000040  6E 6C 00 00 00 00 03 38 70 74 2D 62 72 00 00 00  nl..8...pt-br...
00000050  00 00 03 94 70 74 00 00 00 00 03 F0 72 75 00 00  ”...pt..ð...ru..
00000060  00 00 04 4C 6B 6F 00 00 00 00 04 A8 7A 68 2D 74  L...ko..¨...zh-t
00000070  00 00 00 00 00 00 05 04 7A 68 2D 73 00 00 00 00  ........zh-s....
00000080  00 00 05 60 66 69 00 00 00 00 05 BC 73 76 00 00  `...fi..¼...sv..
00000090  00 00 06 18 64 61 00 00 00 00 06 74 6E 6F 00 00  ....da..t...no..
000000A0  00 00 06 D0 70 6C 00 00 00 00 07 2C 74 72 00 00  Ð...pl..,...tr..

ID Integer

from notification_settings_plugin.rco FW??

Is a Table that only hold Integer values. The values to read are always size of 4 so seems to be an little endian. The first 4 bytes before the Integer value are the loopback offset to add the id int value to the src="" Attribute value.

  • Note: All values are reversed little endian
    • Note2: Not all loopback offset's are used, that depends on the used Attribute identifyer (B-will use loopback- or C-will not use loopback-)
Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F

00000000  00 00 07 A4  1D DD 0E 08  00 00 08 10  21 33 CE EB  ...¤.Ý......!3Îë
00000010  00 00 08 7C  F7 98 83 12  00 00 08 E8  6F 57 E2 51  ...|÷˜ƒ....èoWâQ
00000020  00 00 09 54  86 64 5D 41  00 00 09 C0  29 B9 1F 26  ...T†d]A...À)¹.&
00000030  00 00 0A 6C  D0 A2 72 A1  00 00 0B 34  2F 65 20 05  ...lТr¡...4/e..
00000040  00 00 0C 08  3C 28 8E E9  00 00 0C E0  C7 2C F1 D7  ....<(Žé...àÇ,ñ×
00000050  FF FF FF FF  18 45 D1 0D  00 00 0D 90  3F 18 74 91  ÿÿÿÿ.EÑ.....?.t‘
00000060  FF FF FF FF  70 38 36 4B  00 00 0E 54  AF 37 FB 60  ÿÿÿÿp86K...T¯7û`
00000070  FF FF FF FF  F3 48 8F 99  FF FF FF FF  5F 7B 33 2B  ÿÿÿÿóH.™ÿÿÿÿ_{3+
00000080  FF FF FF FF  9F 20 F8 98  00 00 11 6C  E8 0C 86 23  ÿÿÿÿŸ.ø˜...lè.†#
00000090  FF FF FF FF  20 41 32 74                            ÿÿÿÿ.A2t

ID Hash

from notification_settings_plugin.rco FW??

Is a Table that only hold Integer values. The values to read are always size of 4 so seems to be an little endian. There are no loopback offset's within this table and one integer value is placed after another without any padding. Additional are thoes value's only used for the Attribute Tag id="" from the <styletable> Element.

  • Note: All values are reversed little endian
Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F

00000000  9C 96 91 8B  22 FF 88 BD  01 F8 75 B1  E9 5F 16 28  œ–‘‹"ÿˆ½�øu±é_.(
00000010  38 B6 2B E4  0A 2F 2C D9  63 67 8F EE  2F BC DE AE  8¶+ä./,Ùcg.î/¼Þ®
00000020  DA 39 A3 EE  20 2F 57 0C  86 D6 DE 69  22 43 90 D9  Ú9£î./W.†ÖÞi"C.Ù
00000030  DD 31 50 3B                                         Ý1P;

Integer Array

from notification_settings_plugin.rco FW??

This Array hold integer values. It is little endian alligned. That means for one integer value we have to read 4 bytes. This need also to be respected for the Offset and Length to read. Like if the given offset is 9 then we can say 9 * 4(bytes) == offset 0x24. We start to read on offset 0x24. Also we have to use the same calculation for the given values to read, if length is 2 then we calc 2 * 4(bytes) == 8 bytes to read where a union of 4 bytes is one single integer value.

*To complete our example: given offset to read from = 9 ~ 0x24, given length of value = 2 ~ 0x08 == 0x00000002 & 0x00000000 =~ attribute="2, 0"

*Note: All values are reversed little endian

Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F

00000000  00 00 00 01  00 00 00 00  00 00 00 00  00 00 00 01
00000010  00 00 00 04  00 00 00 00  00 00 00 02  00 00 00 01
00000020  00 00 00 05  00 00 00 02  00 00 00 00

Float Array

from notification_settings_plugin.rco FW??

This Array hold single float values. In case of a single float value consit's of 4 bytes we need to use the same calculation then for the Integer Array.

* As example: Given offset * 4 == Offset within float Array to start to read from. Given value length * 4 == length to read from the float Array. Where a union of 4 bytes is one single float value.

*Note: All values are reversed little endian (hex values!!)

Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F                          Converted Float's    01    02    03    04

00000000  3E FA E1 48  3F 80 00 00  3F 80 00 00  3F 80 00 00                              00000000        0,49    1     1     1
00000010  3F 80 00 00  44 70 00 00  43 E0 00 00  00 00 00 00                              00000010         1     960   448    0
00000020  00 00 00 00  44 52 00 00  42 A0 00 00  43 E7 00 00                              00000020         0     840    80   462
00000030  00 00 00 00  C3 88 00 00  00 00 00 00  C1 F0 00 00                              00000030         0    -272    0    -30
00000040  00 00 00 00  42 70 00 00  42 70 00 00  42 38 00 00                              00000040         0      60    60    46
00000050  42 38 00 00  44 16 80 00  00 00 00 00  42 3C 00 00                              00000050         46    602    0     47
00000060  42 3C 00 00  44 70 00 00  42 A0 00 00  43 C7 00 00                              00000060         47    960    80   398
00000070  00 00 00 00  C3 4E 00 00  00 00 00 00  C2 20 00 00                              00000070         0    -206    0    -40
00000080  00 00 00 00  43 A5 00 00  00 00 00 00                                           00000080         0     330    0

File Table

The files are concatenated in the same order than in the Tree Table & ID's Table (ID String & Integer). The xml's are stored as CXML Container's and are zlib compressed as well. Additional will a Vita RCO hold the most common file format's that Sony allready used in the past for resource files. Which are as follow: VAG, GTF, DDS, GIM

Summary

How all the Tables work together you can check below on a example from the HeavyRain.p3t PS3 Theme:

* Don't worry that it is a PS3 Theme. The work down of the CXML is the same like for a Vita RCO

Table Description

                    Tree Table of HeavyRain.p3t                                                                     ID Table of HeavyRain.p3t

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
00000050      [...]   00 00 00 15 00 00 00 03 00 00 00 1D      ............                     00000000  00 00 01 24 65 6E 00 00 00 01 60 6A 70 00 00 00  ...$en....`jp...                     
00000060  00 00 00 06 00 00 00 24 00 00 00 01 00 07 E9 80  .......$......é€                     00000010  01 C8 69 63 6F 6E 5F 75 73 65 72 00 00 00 02 14  .Èicon_user.....
00000070  00 00 00 00 00 00 00 30 00 00 00 03 00 00 00 35  .......0.......5                     00000020  69 63 6F 6E 5F 73 65 74 74 69 6E 67 00 00 00 02  icon_setting....
00000080  00 00 00 10 00 00 00 46 00 00 00 03 00 00 00 4D  .......F.......M                     00000030  60 69 63 6F 6E 5F 70 68 6F 74 6F 00 00 00 02 AC  `icon_photo....¬
00000090  00 00 00 0C 00 00 00 5A 00 00 00 03 00 00 00 5E  .......Z.......^                     00000040  69 63 6F 6E 5F 6D 75 73 69 63 00 00 00 02 F8 69  icon_music....øi
000000A0  00 00 00 1B 00 00 00 7A 00 00 00 01 00 00 40 80  .......z......@€                     00000050  63 6F 6E 5F 76 69 64 65 6F 00 00 00 03 44 69 63  con_video....Dic
000000B0  00 00 00 00 00 00 00 89 00 00 00 06 00 00 00 00  .......‰........                     00000060  6F 6E 5F 67 61 6D 65 00        [...]             on_game   [...]
000000C0  00 00 1A 0B 00 00 00 94 00 00 00 01 00 00 40 80  .......”......@€
000000D0  00 00 00 00 00 00 00 9D 00 00 00 03 00 00 00 A5  ...............¥                                         String Table of HeavyRain.p3t
000000E0  00 00 00 0B 00 00 00 B1 00 00 00 03 00 00 00 B7  .......±.......·
000000F0  00 00 00 0E 00 00 00 C6 00 00 00 03 00 00 00 CC  .......Æ.......Ì                     Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000100  00 00 00 06 00 00 00 D3 00 00 00 06 00 00 1A 10  .......Ó........                     00000000  74 68 65 6D 65 00 69 6E 66 6F 74 61 62 6C 65 00  theme.infotable.
00000110  00 02 12 99 00 00 00 DB 00 00 00 06 00 02 2C B0  ...™...Û......,°                     00000010  69 6E 66 6F 00 63 6F 6D 6D 65 6E 74 00 45 6E 6A  info.comment.Enj
00000120  00 00 1F CE 00 00 00 E0 00 00 00 02 00 00 00 1C  ...Î...à........                     00000020  6F 79 2E 00 70 72 65 76 69 65 77 73 69 7A 65 00  oy..previewsize.
00000130  00 00 00 38 00 00 01 60 FF FF FF FF FF FF FF FF  ...8...`ÿÿÿÿÿÿÿÿ                     00000030  6E 61 6D 65 00 48 45 41 56 59 20 52 61 69 6E 20  name.HEAVY.Rain.
00000140  00 00 00 EE 00 00 00 07 00 00 00 00 00 00 00 00  ...î............                     00000040  74 68 65 6D 65 00 61 75 74 68 6F 72 00 51 75 61  theme.author.Qua
00000150  00 00 00 30 00 00 00 03 00 00 00 35 00 00 00 10  ...0.......5....                     00000050  6E 74 69 63 44 72 65 61 6D 00 75 72 6C 00 68 74  nticDream.url.ht
00000160  00 00 00 E0 00 00 00 03 00 00 00 1C 00 00 01 24  ...à...........$                     00000060  74 70 3A 2F 2F 77 77 77 2E 71 75 61 6E 74 69 63  tp://www.quantic
00000170  FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 EE  ÿÿÿÿÿÿÿÿÿÿÿÿ...î                     00000070  64 72 65 61 6D 2E 63 6F 6D 00 61 75 74 68 6F 72  dream.com.author
00000180  00 00 00 07 00 00 00 07 00 00 00 00 00 00 00 15  ................                     00000080  69 63 6F 6E 73 69 7A 65 00 61 75 74 68 6F 72 69  iconsize.authori
00000190  00 00 00 03 00 00 00 F5 00 00 00 33 00 00 00 30  .......õ...3...0                     00000090  63 6F 6E 00 69 63 6F 6E 73 69 7A 65 00 76 65 72  con.iconsize.ver
000001A0  00 00 00 03 00 00 00 35 00 00 00 10 00 00 01 29  .......5.......)                     000000A0  73 69 6F 6E 00 76 65 72 73 69 6F 6E 20 31 2E 30  sion.version.1.0
                                                                                                000000B0  00 6D 74 69 6D 65 00 32 30 30 39 31 30 33 30 31  .mtime.200910301
                                                                                                000000C0  36 31 33 34 33 00 67 65 6E 72 65 00 6F 74 68 65  61343.genre.othe
                                                                                                000000D0  72 73 00 70 72 65 76 69 65 77 00 69 63 6F 6E 00  re.preview.icon.
                                                                                                000000E0  6C 6F 63 61 6C 69 7A 65 64 69 6E 66 6F 00 6C 6F  localizedinfo.lo
                                                                                                000000F0  63 61 6C 65 00 E3 81 93 E3 82 8C E3 81 AF E3 82  cale.これはã‚
                                                                                                00000100  B5 E3 83 B3 E3 83 97 E3 83 AB E3 83 86 E3 83 BC  µãƒ³ãƒ—ルテー
                                                                                                00000110  E3 83 9E E3 83 95 E3 82 A1 E3 82 A4 E3 83 AB E3  マファイルã
                                                                                                00000120  81 A7 E3 81 99 E3 80 82 00 69 63 6F 6E 74 61 62  §ã™ã€‚.icontab
                                                                                                00000130  6C 65 00 73 72 63 00 69 64 00 73 69 7A 65 00 70  le.src.id.size.p
                                                                                                00000140  6F 69 6E 74 65 72 74 61 62 6C 65 00 70 6F 69 6E  ointertable.poin
                                                                                                00000150  74 65 72 00 62 61 73 65 5F        [...]          ter.base_ [...]


String Pointer  Points to a Offset within String Table which represents a string (in this case a Attribute <comment>)                    Previous Element

Typ Descriptor  A Integer value which describe the Typ of the Attribute (3 == String)                                                    Next Element

String Offset  A Integer value which describe the Offset of a String within String Table                                                 First Entry

Length of String  A Integer value which describe the Length of the String to read from String Table                                      Last Entry

String Pointer  -"- (in this case a Attribute <previewsize>)                                                                             String Pointer  -"- (in this case a Attribute <local>)

Typ Descriptor  A Integer value which describe the Typ of the Attribute (1 == Integer)                                                   Typ Descriptor  -"- (7 == ID)

Integer Hex Value  A Integer Value which describe the size of the icon "preview"                                                         ID Offset

String Pointer  -"- (in this case a Attribute <name>)                                                                                    String Pointer  -"- (in this case a Attribute <name>)

Typ Descriptor  -"- (3 == String)                                                                                                        Typ Descriptor  -"- (3 == String)

String Offset                                                                                                                            String Offset

Length of String                                                                                                                         Length of String

String Pointer  -"- (in this case a Attribute <author>)                                                                                  String Pointer  -"- (in this case a Element <localizedinfo>)

Typ Descriptor  -"- (3 == String)                                                                                                        Attribute Counter  (0x03 == 3)

String Offset                                                                                                                            Parent

Length of String                                                                                                                         Previous Element

String Pointer  -"- (in this case a Attribute <url>                                                                                      Next Element

Typ Descriptor  -"- (3 == String))                                                                                                       First Entry

String Offset                                                                                                                            Last Entry

Length of String                                                                                                                         String Pointer  -"- (in this case a Attribute <local>)

String Pointer  -"- (in this case a Attribute <authoriconsize>)                                                                          Typ Descriptor  -"- (7 == ID)

Typ Descriptor  -"- (1 == Integer)                                                                                                       ID Offset

Integer Hex Value  -"- "authoriconsize"                                                                                                  String Pointer  -"- (in this case a Attribute <comment>)

String Pointer  -"- (in this case a Attribute <authoricon>)                                                                              Typ Descriptor  -"- (3 == String)

Typ Descriptor  -"- (6 == File)                                                                                                          String Offset

Offset of Filedata                                                                                                                       Length of String

Size of Filedata                                                                                                                         String Pointer  -"- (in this case a Attribute <name>)

[...] this repeats till the last Attribute. I will describe on the right side the <localizedinfo> Elements. So we jump back in on Offset 0x124 [...]

String Pointer  -"- (in this case a Element <localizedinfo>)                                                                             Typ Descriptor  -"- (3 == String)

Attribute Counter  (0x02 == 2)                                                                                                           String Offset

Parent                                                                                                                                   Length of String

XML Output

This is the Output, saved as xml, from the notification_settings_plugin.rco on 3.60 DevKit Firmware

   <?xml version="1.0" encoding="utf-8"?>
   <resource version="0.100000001490116f" type="normal">
     <stringtable>
       <locale origsize="1120" src="files\original\ja.z" compress="on" id="ja" />
       <locale origsize="1344" src="files\original\en-gb.z" compress="on" id="en-gb" />
       <locale origsize="1344" src="files\original\en.z" compress="on" id="en" />
       <locale origsize="1424" src="files\original\fr.z" compress="on" id="fr" />
       <locale origsize="1488" src="files\original\es.z" compress="on" id="es" />
       <locale origsize="1392" src="files\original\de.z" compress="on" id="de" />
       <locale origsize="1376" src="files\original\it.z" compress="on" id="it" />
       <locale origsize="1392" src="files\original\nl.z" compress="on" id="nl" />
       <locale origsize="1408" src="files\original\pt-br.z" compress="on" id="pt-br" />
       <locale origsize="1392" src="files\original\pt.z" compress="on" id="pt" />
       <locale origsize="1408" src="files\original\ru.z" compress="on" id="ru" />
       <locale origsize="1120" src="files\original\ko.z" compress="on" id="ko" />
       <locale origsize="1072" src="files\original\zh-t.z" compress="on" id="zh-t" />
       <locale origsize="1072" src="files\original\zh-s.z" compress="on" id="zh-s" />
       <locale origsize="1360" src="files\original\fi.z" compress="on" id="fi" />
       <locale origsize="1328" src="files\original\sv.z" compress="on" id="sv" />
       <locale origsize="1328" src="files\original\da.z" compress="on" id="da" />
       <locale origsize="1328" src="files\original\no.z" compress="on" id="no" />
       <locale origsize="1392" src="files\original\pl.z" compress="on" id="pl" />
       <locale origsize="1392" src="files\original\tr.z" compress="on" id="tr" />
     </stringtable>
     <texturetable>
       <texture origsize="5328" src="files\original\1DDD0E08.z" compress="on" id="1DDD0E08" type="texture/gim" />
       <texture origsize="7632" src="files\original\2133CEEB.z" compress="on" id="2133CEEB" type="texture/gim" />
       <texture origsize="7632" src="files\original\F7988312.z" compress="on" id="F7988312" type="texture/gim" />
       <texture origsize="5328" src="files\original\6F57E251.z" compress="on" id="6F57E251" type="texture/gim" />
       <texture origsize="7632" src="files\original\86645D41.z" compress="on" id="86645D41" type="texture/gim" />
       <texture origsize="7632" src="files\original\100DEBD1.z" compress="on" id="100DEBD1" type="texture/gim" />
       <texture src="files\original\29B91F26.z" origsize="57648" div_ratio_h="[0.490000009536743f]" compress="on" margin_v="[1]" id="29B91F26" margin_h="[1]" type="texture/gim" div_mode="3x1" />
       <texture src="files\original\D0A272A1.z" origsize="57648" div_ratio_h="[0.490000009536743f]" compress="on" margin_v="[1]" id="D0A272A1" margin_h="[1]" type="texture/gim" div_mode="3x1" />
     </texturetable>
     <styletable>
       <style_button id="2F652005" bg_obj="9C96918B" glow_obj="22FF88BD">
         <planeobj texture0="29B91F26" id="9C96918B" />
         <planeobj texture0="D0A272A1" blend="2" id="22FF88BD" />
       </style_button>
       <style_text textobj="01F875B1" id="3C288EE9">
         <textobj font_size="28f" bold="1" color="[1f, 1f, 1f, 1f]" max_line_count="2" line_pitch="28f" word_wrap="1" ellipsis="1" id="01F875B1" />
       </style_text>
       <style_plane id="C72CF1D7" planeobj="E95F1628">
         <planeobj texture0="1845D10D" id="E95F1628" />
       </style_plane>
     </styletable>
     <pagetable />
     <templatetable>
       <template id="3F187491">
         <file_list style="7038364B" id="38B62BE4">
           <layout_hint align="[0, 0]" size="[960f, 448f]" id="0A2F2CD9" pos="[0f, 0f]" />
         </file_list>
       </template>
       <template fast_open="1" id="AF37FB60">
         <list_item style="F3488F99" id="63678FEE">
           <layout_hint align="[0, 0]" size="[840f, 80f]" id="0A2F2CD9" pos="[0f, 0f]" />
           <text style="3C288EE9" id="2FBCDEAE">
             <layout_hint size="[462f, 0f]" align="[1, 4]" adjust="[0, 2]" id="DA39A3EE" pos="[-272f, 0f]" />
             <plane style="5F7B332B" id="202F570C">
               <layout_hint pos="[-30f, 0f]" id="DA39A3EE" adjust="[0, 0]" alpha="0f" anchor="[1, 5]" size="[60f, 60f]" />
             </plane>
             <check_box style="9F20F898" id="86D6DE69">
               <layout_hint align="[2, 0]" size="[46f, 46f]" pos="[602f, 0f]" anchor="[1, 5]" id="DA39A3EE" />
               <focus_hint focus_shape="0" focus_size="[47f, 47f]" />
             </check_box>
           </text>
         </list_item>
       </template>
       <template fast_open="1" id="E80C8623">
         <list_item style="F3488F99" id="63678FEE">
           <layout_hint align="[0, 0]" size="[840f, 80f]" id="0A2F2CD9" pos="[0f, 0f]" />
           <button sound="20413274" style="2F652005" id="224390D9">
             <layout_hint size="[840f, 80f]" adjust="[0, 0]" id="DA39A3EE" pos="[0f, 0f]" />
             <focus_hint focus_shape="3" focus_size="[960f, 80f]" />
             <text style="3C288EE9" id="2FBCDEAE">
               <layout_hint size="[398f, 0f]" align="[1, 4]" adjust="[0, 2]" id="DA39A3EE" pos="[-206f, 0f]" />
               <plane style="5F7B332B" id="202F570C">
                 <layout_hint pos="[-40f, 0f]" id="DA39A3EE" adjust="[0, 0]" alpha="0f" anchor="[1, 5]" size="[60f, 60f]" />
               </plane>
             </text>
             <plane style="C72CF1D7" id="DD31503B">
               <layout_hint size="[46f, 46f]" align="[2, 0]" adjust="[0, 0]" id="DA39A3EE" pos="[330f, 0f]" />
             </plane>
           </button>
         </list_item>
       </template>
     </templatetable>
   </resource>

Other useful links

So what of old but still handy VAG2WAV WAV2VAG Source