CXML Containers

From PS3 Developer wiki
Revision as of 07:10, 14 June 2014 by Euss (talk | contribs)
Jump to navigation Jump to search

Description

Container Structure

XML implicit structure Overview

Container Common Structure

Header

Etc...

Container Structure variations

QRC

P3T

P3TF

P3TF (Playstation 3 Theme Flat?)

Main Header

The header contains an identifyer of the container (magic), his version, and allows to store the "absolute start offset" and "size" of 7 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 previouslly "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 .RAF and .QRC with some variations) so the usage of this tables can vary, in this example there are 3 "not used tables":
    • two of the "not used tables" (both at offset 0x460 with a size of 0) are placed before an used table (also at offset 0x460 but with a size of 0x23A0)
    • the other "not used table" is placed at the end, so there is no need to store his offset
Offset(h) 00 01 02 03  04 05 06 07  08 09 0A 0B  0C 0D 0E 0F
00000000  50 33 54 46  00 00 01 10  00 00 00 40  00 00 02 CC  P3TF.......@..%|
00000010  00 00 03 10  00 00 01 2B  00 00 04 40  00 00 00 1B  ..%À......9Ð....
00000020  00 00 04 60  00 00 00 00  00 00 04 60  00 00 00 00  ..9ð......9ð....
00000030  00 00 04 60  00 00 23 A0  00 00 00 00  00 00 00 00  ..9ð..@p........
Name Offset Size Example Remark
Magic 0x00 0x04 51 52 43 46 'P3TF'
Version 0x04 0x04 00 00 01 10
Tree Table Offset 0x08 0x04 00 00 00 40
Tree Table Size 0x0C 0x04 00 00 02 CC
ID Table Offset 0x10 0x04 00 00 03 10
ID Table Size 0x14 0x04 00 00 01 2B
String Table Offset 0x18 0x04 00 00 04 40
String Table Size 0x1C 0x04 00 00 00 1B
Integer Array Offset 0x20 0x04 00 00 04 60 Overlapped
Integer Array size 0x24 0x04 00 00 00 00 Not used
Float Array Offset 0x28 0x04 00 00 04 60 Overlapped
Float Array Size 0x2C 0x04 00 00 00 00 Not used
File Table Offset 0x30 0x04 00 00 04 60 Overlaps the previous 2 tables
File Table Size 0x34 0x04 00 00 23 A0
Unknown Table Offset 0x38 0x04 00 00 00 00 Not present
Unknown Table Size 0x3C 0x04 00 00 00 00 Not Used
  • Notes
    • The sizes doesnt includes the (posible) padding at the end of all tables


Tree Table

Offset Size Example Remark
0x00 0x08 00 00 00 00 00 00 00 00 similar all p3t files
0x08 0x08 FF FF FF FF FF FF FF FF similar all p3t files
0x10 0x04 FF FF FF FF similar all p3t files
0x14 0x04 00 00 00 1C First Element within the root Element (p3t)
0x18 0x04 00 00 18 B4 Last Element within the root Element (p3t)
0x1C 0x04 00 00 00 06 First Element (Offset within String Table, in this case it will be <infotable>)
0x20 0x08 00 00 00 00 00 00 00 00 similar all p3t files
0x28 0x04 FF FF FF FF Previous ELement
0x2C 0x04 00 00 01 AC Next Element
0x30 0x04 00 00 00 38 First Entry
0x34 0x04 00 00 01 60 Last Entry
0x38 0x04 00 00 00 10 Element Pointer (Offset within String Table, in this case it will be <info>)
0x3C 0x04 00 00 00 0D Attribute Counter (0x0D == 13, the 13 Attributes of <info> Element)
0x40 0x04 00 00 00 1C Parent Element (Offset withing Tree Table, in this case it will be <infotable>)
0x44 0x04 FF FF FF FF Previous Element
0x48 0x04 00 00 01 24 Next Element
0x4C 0x04 FF FF FF FF First Entry
0x50 0x04 FF FF FF FF Last Entry


String Table

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 doesnt makes differences of the "directory hierarchy" of the tags neither is specifyed 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  74 68 65 6D 65 00 69 6E 66 6F 74 61 62 6C 65 00  theme.infotable.
00000010  69 6E 66 6F 00 63 6F 6D 6D 65 6E 74 00 45 6E 6A  info.comment.Enj
00000020  6F 79 2E 00 70 72 65 76 69 65 77 73 69 7A 65 00  oy..previewsize.
00000030  6E 61 6D 65 00 48 45 41 56 59 20 52 61 69 6E 20  name.HEAVY.Rain.
00000040  74 68 65 6D 65 00 61 75 74 68 6F 72 00 51 75 61  theme.author.Qua
00000050  6E 74 69 63 44 72 65 61 6D 00 75 72 6C 00 68 74  nticDream.url.ht
00000060  74 70 3A 2F 2F 77 77 77 2E 71 75 61 6E 74 69 63  tp://www.quantic
00000070  64 72 65 61 6D 2E 63 6F 6D 00 61 75 74 68 6F 72  dream.com.author
00000080  69 63 6F 6E 73 69 7A 65 00 61 75 74 68 6F 72 69  iconsize.authori
00000090  63 6F 6E 00 69 63 6F 6E 73 69 7A 65 00 76 65 72  con.iconsize.ver
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 78 00 62 61 73 65 5F  ter.base_X.base_
00000160  79 00 6E 6F 74 69 66 69 63 61 74 69 6F 6E 00 62  y.notification.b
00000170  67 69 6D 61 67 65 74 61 62 6C 65 00 62 67 69 6D  gimagetable.bgim
00000180  61 67 65 00 61 6E 69 6D 00 66 6F 6E 74 00 73 65  age.anim.font.se
00000190  6C 65 63 74 69 6F 6E 00 63 6F 6C 6F 72 00 00 00  lection.color
  • 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 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

The ID Table of a P3T also can hold additional information for the <localizedinfo> Element.

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  00 00 01 24 65 6E 00 00 00 01 60 6A 70 00 00 00  ...$en....`jp...
00000010  01 C8 69 63 6F 6E 5F 75 73 65 72 00 00 00 02 14  .Èicon_user.....
00000020  69 63 6F 6E 5F 73 65 74 74 69 6E 67 00 00 00 02  icon_setting....
00000030  60 69 63 6F 6E 5F 70 68 6F 74 6F 00 00 00 02 AC  `icon_photo....¬
00000040  69 63 6F 6E 5F 6D 75 73 69 63 00 00 00 02 F8 69  icon_music....øi
00000050  63 6F 6E 5F 76 69 64 65 6F 00 00 00 03 44 69 63  con_video....Dic
00000060  6F 6E 5F 67 61 6D 65 00                          on_game


File Table

The files are not concatenated in the same order than in the Tree Table & ID Table. There are even some file within the File Table which are not contained in ID Table(anim.raf, authoricon, ect.,...).

RAF

Examples

QRC

P3T

RAF

Tools

. .. ...