SILKPADD

From PS3 Developer wiki
Revision as of 01:58, 6 October 2018 by Sandungas (talk | contribs) (→‎CEDialog: partially confirmed, use the "color picker" of an image edition app with the "navigation bar" images extracted from CEHtmlBrowserApp.bin ... and the backgrounds are exactly #C0C0C0)
Jump to navigation Jump to search

Structure

Header

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

00000000  53 49 4C 4B 50 41 44 44 00 00 0C 00 00 00 00 00  SILKPADD........
Offset Length Example Name Notes
0x00 0x04 53 49 4C 4B silk_signature By now this 2 are represented in wiki separated just incase the format allows for other variants, like SILKFLAT, SILKCRAP, or any other names, but maybe the 8 bytes are processed together
0x04 0x04 50 41 44 44 padd_signature
0x08 0x02 00 00 unknown Always zeroes ?
0x0A 0x02 0C 00 entry_amount Number of entries in the file (in little endian)
0x0C 0x04 00 00 00 00 padding ? Always zeroes ?

Index table

The index table starts at offset 0x10, every entry in the index table is 0xC bytes lenght and is composed by 3 values. All values in the index table are in little endian. There is no gap or padding at the end of the index table

Example of the first entry in the index table of CEHtmlApi.bin

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

00000010  B9 0B 00 00 A0 00 00 00 9B 00 00 00              ¹... ...›...
Offset Length Example Name Notes
0x00 0x04 B9 0B 00 00 entry_id An unique ID for the entry, used by the web browser to identify and to access the data (in little endian)
0x04 0x04 A0 00 00 00 data_offset Absolute offset of the data (in little endian)
0x08 0x04 9B 00 00 00 data_lenght Size of the data (in little endian)

Data table

At this point is unknown if the PS3 parses every one of the datas in a specific way based on his type because the IDs of them are hardcoded in the .sprx (so the sprx knows what to do with every data before reading it), or the data type is identifyed by reading the first bytes. Anyway, to manage the datas in PC is needed to read the first bytes because in PC we are not using a database with all the IDs (so we dont know what to do with every data entry before reading it)

This identification method (by reading the data itself) is what is explained here in wiki, the order of how are listed the data types in this wiki page is also a suggestion of the order of how the data types checks could be performed

Data types

All data entries starts with 4 bytes + a text string. The first 4 bytes indicates the length of the text string located inmediatly after. So the first bytes that needs to be readed are the 4 bytes + the lenght indicated by that 4 bytes

Text string

This is the most basic example, the entry can be identifyed as a "text string" because is null terminated (note how the text_string_lenght=5 of the example below includes the null byte 0x00 at the end)

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

00000000  00 00 00 05 54 65 73 74 00                       ....Test.
Offset Length Example Name Notes
0x00 0x04 00 00 00 05 text_string_lenght Lenght of the next text string + 1 null byte at the end (in big endian)
0x04 varies 54 65 73 74 text_string A normal text string (starting with random characters that doesnt matches the search patterns for the other data type checks)
varies 0x01 00 null This is the null termination of the previous string
HTML (stored as a single text string

The fileformat allows to store HTML files as standard text string data, and are also null terminated (so it falls under the same characteristics as a standard text string). Because this reason, the only way to identify this data type in PC is by reading the first bytes of the string (if it starts with <!DOCTYPE HTML is a HTML)

To extract the data as a HTML file is needed to remove the null byte at the end (and the null byte at the end needs to be added when the HTML file is injected back)

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

00000000  00 00 03 A9 3C 21 44 4F 43 54 59 50 45 20 48 54  ...©<!DOCTYPE HT
00000010  4D 4C 20 50 55 42 4C 49 43 20 22 2D 2F 2F 57 33  ML PUBLIC "-//W3
00000020  43 2F 2F 44 54 44 20 48 54 4D 4C 20 34 2E 30 20  C//DTD HTML 4.0 
00000030  54 72 61 6E 73 69 74 69 6F 6E 61 6C 2F 2F 45 4E  Transitional//EN
00000040  22 3E 0A 09 09 09 09 09 3C 48 54 4D 4C 3E 0A 09  ">......<HTML>..
00000050  09 09 09 09 3C 48 45 41 44 3E 0A 09 09 09 09 09  ....<HEAD>......
00000060  09 3C 73 74 79 6C 65 3E 0A 09 09 09 09 09 09 61  .<style>.......a
00000070  3A 6C 69 6E 6B 09 09 09 7B 66 6F 6E 74 3A 38 70  :link...{font:8p
00000080  74 2F 31 31 70 74 20 76 65 72 64 61 6E 61 3B 20  t/11pt verdana; 
00000090  63 6F 6C 6F 72 3A 72 65 64 7D 0A 09 09 09 09 09  color:red}......
000000A0  09 61 3A 76 69 73 69 74 65 64 09 09 7B 66 6F 6E  .a:visited..{fon
000000B0  74 3A 38 70 74 2F 31 31 70 74 20 76 65 72 64 61  t:8pt/11pt verda
000000C0  6E 61 3B 20 63 6F 6C 6F 72 3A 23 34 65 34 65 34  na; color:#4e4e4
000000D0  65 7D 0A 09 09 09 09 09 09 3C 2F 73 74 79 6C 65  e}.......</style
000000E0  3E 0A 09 09 09 09 09 09 3C 6D 65 74 61 20 48 54  >.......<meta HT
000000F0  54 50 2D 45 51 55 49 56 3D 22 43 6F 6E 74 65 6E  TP-EQUIV="Conten
00000100  74 2D 54 79 70 65 22 20 43 6F 6E 74 65 6E 74 3D  t-Type" Content=
00000110  22 74 65 78 74 2D 68 74 6D 6C 3B 20 63 68 61 72  "text-html; char
00000120  73 65 74 3D 57 69 6E 64 6F 77 73 2D 31 32 35 32  set=Windows-1252
00000130  22 3E 0A 09 09 09 09 09 09 3C 74 69 74 6C 65 3E  ">.......<title>
00000140  4E 65 74 77 6F 72 6B 20 45 72 72 6F 72 3C 2F 74  Network Error</t
00000150  69 74 6C 65 3E 0A 09 09 09 09 09 3C 2F 48 45 41  itle>......</HEA
00000160  44 3E 0A 0A 09 09 09 09 09 3C 42 4F 44 59 3E 0A  D>.......<BODY>.
00000170  09 09 09 09 09 09 3C 54 41 42 4C 45 20 77 69 64  ......<TABLE wid
00000180  74 68 3D 22 34 30 30 22 20 63 65 6C 6C 70 61 64  th="400" cellpad
00000190  64 69 6E 67 3D 22 33 22 20 63 65 6C 6C 73 70 61  ding="3" cellspa
000001A0  63 69 6E 67 3D 22 35 22 3E 0A 09 09 09 09 09 09  cing="5">.......
000001B0  20 20 3C 74 72 3E 0A 09 09 09 09 09 09 09 3C 74    <tr>........<t
000001C0  64 20 69 64 3D 22 74 61 62 6C 65 50 72 6F 70 73  d id="tableProps
000001D0  22 20 76 61 6C 69 67 6E 3D 22 74 6F 70 22 20 61  " valign="top" a
000001E0  6C 69 67 6E 3D 22 6C 65 66 74 22 3E 3C 2F 74 64  lign="left"></td
000001F0  3E 0A 09 09 09 09 09 09 09 3C 74 64 20 69 64 3D  >........<td id=
00000200  22 74 61 62 6C 65 50 72 6F 70 73 32 22 20 61 6C  "tableProps2" al
00000210  69 67 6E 3D 22 6C 65 66 74 22 20 76 61 6C 69 67  ign="left" valig
00000220  6E 3D 22 6D 69 64 64 6C 65 22 20 77 69 64 74 68  n="middle" width
00000230  3D 22 34 35 30 22 3E 3C 68 31 20 69 64 3D 22 74  ="450"><h1 id="t
00000240  65 78 74 53 65 63 74 69 6F 6E 31 22 0A 09 09 09  extSection1"....
00000250  09 09 09 09 73 74 79 6C 65 3D 22 43 4F 4C 4F 52  ....style="COLOR
00000260  3A 20 62 6C 61 63 6B 3B 20 46 4F 4E 54 3A 20 31  : black; FONT: 1
00000270  38 70 74 20 76 65 72 64 61 6E 61 22 3E 3C 73 70  8pt verdana"><sp
00000280  61 6E 20 69 64 3D 22 65 72 72 6F 72 54 65 78 74  an id="errorText
00000290  22 3E 54 68 65 20 70 61 67 65 20 63 61 6E 6E 6F  ">The page canno
000002A0  74 20 62 65 20 64 69 73 70 6C 61 79 65 64 2E 3C  t be displayed.<
000002B0  2F 73 70 61 6E 3E 3C 2F 68 31 3E 3C 2F 74 64 3E  /span></h1></td>
000002C0  0A 09 09 09 09 09 09 20 20 3C 2F 74 72 3E 0A 09  .......  </tr>..
000002D0  09 09 09 09 09 20 20 3C 74 72 3E 0A 09 09 09 09  .....  <tr>.....
000002E0  09 09 09 3C 74 64 20 69 64 3D 22 74 61 62 6C 65  ...<td id="table
000002F0  50 72 6F 70 73 57 69 64 74 68 22 20 77 69 64 74  PropsWidth" widt
00000300  68 3D 22 34 30 30 22 20 63 6F 6C 73 70 61 6E 3D  h="400" colspan=
00000310  22 32 22 3E 3C 66 6F 6E 74 0A 09 09 09 09 09 09  "2"><font.......
00000320  09 73 74 79 6C 65 3D 22 43 4F 4C 4F 52 3A 20 62  .style="COLOR: b
00000330  6C 61 63 6B 3B 20 46 4F 4E 54 3A 20 31 31 70 74  lack; FONT: 11pt
00000340  20 76 65 72 64 61 6E 61 22 3E 0A 09 09 09 09 09   verdana">......
00000350  09 09 4E 65 74 77 6F 72 6B 20 65 72 72 6F 72 20  ..Network error 
00000360  6F 63 63 75 72 72 65 64 2E 3C 2F 66 6F 6E 74 3E  occurred.</font>
00000370  3C 2F 74 64 3E 0A 09 09 09 09 09 09 20 20 3C 2F  </td>.......  </
00000380  74 72 3E 0A 09 09 09 09 09 09 3C 2F 54 41 42 4C  tr>.......</TABL
00000390  45 3E 0A 09 09 09 09 09 3C 2F 42 4F 44 59 3E 0A  E>......</BODY>.
000003A0  09 09 09 09 09 3C 2F 48 54 4D 4C 3E 00           .....</HTML>.
Offset Length Example Name Notes
0x00 0x04 00 00 03 A9 text_string_lenght Size of the HTML file + 1 null byte at the end (in big endian)
0x04 varies <!DOCTYPE HTML, etc... text_string HTML file
varies 0x01 00 null This is the null termination at the end of the HTML file (needed to be removed to extract the data as a HTML file)
CEBinary

The CEBinary data type indicates this data is a binary file, there are several predefined file types allowed (explained below)

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

00000000  00 00 00 08 43 45 42 69 6E 61 72 79 00 00 00 00  ....CEBinary....
00000010  00 09 69 6D 61 67 65 5C 67 69 66 00 00 00 7C 47  ..image\gif...|G
00000020  49 46 38 39 61 09 00 0B 00 B3 00 00 99 66 00 FF  IF89a....³..™f.ÿ
00000030  AD 5B E6 CE AE FF F1 B9 FF CC 99 FF FF CC FF C2  ­[æήÿñ¹ÿÌ™ÿÿÌÿÂ
00000040  86 FF D6 AC FF B5 6A 00 FF 00 00 00 00 00 00 00  †ÿÖ¬ÿµj.ÿ.......
00000050  00 00 00 00 00 00 00 00 00 00 00 00 21 F9 04 05  ............!ù..
00000060  14 00 09 00 2C 00 00 00 00 09 00 0B 00 00 04 29  ....,..........)
00000070  50 00 31 AA 05 03 DB 0A 8A DE DD 77 79 53 29 79  P.1ª..Û.ŠÞÝwyS)y
00000080  06 90 06 40 48 00 2F D2 16 C3 41 10 86 DC D5 77  ...@H./Ò.ÃA.†ÜÕw
00000090  3E F3 38 1D CD 16 04 44 00 00 3B                 >ó8.Í..D..;
Offset Length Example Name Notes
0x00 0x04 00 00 00 08 text_string_lenght Lenght of the next text string (in big endian)
0x04 0x08 CEBinary text_string CEBinary data type. Without the null termination !
0x0C 0x02 00 00 unknown Always zeroes ?
0x0E 0x04 00 00 00 09 text_string_lenght Lenght of the next text string (in big endian)
0x12 varies image\gif text_string File type. Without the null termination !. Some predefined filetypes found:
image\png
image\gif
image\gifPushed (it seems this files are png)
image\ms-cursor (microsoft .cur file extension)
image\ms-icon (microsoft .ico file extension)
etc...
varies 0x04 00 00 00 7C file_leght Indicates the size of the file (in big endian)
varies varies GIF, etc... file_data This is the file
CEMenu
CEDialog

The CEDialog is a complex data type that represents the root of a hierarchy of parent/chidren/brothers, every one of them have an unique ID (and this IDs seems to be consecutive)

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

00000000  00 00 00 08 43 45 44 69 61 6C 6F 67 00 00 27 56  ....CEDialog..'V
00000010  00 00 00 00 00 00 00 00 00 00 01 09 00 00 00 55  ...............U
00000020  00 01 00 63 FF C0 C0 C0 FF 00 00 00 00 00 00 0C  ...cÿÀÀÀÿ.......
00000030  00 00 00 05 01 00 00 00 0F 43 45 52 65 63 74 43  .........CERectC
00000040  6F 6D 70 6F 6E 65 6E 74 00 00 27 57 00 00 00 0A  omponent..'W....
00000050  00 00 00 08 00 00 00 20 00 00 00 20 00 00 00 83  ....... ... ...ƒ
00000060  FF FF FF FF FF 00 00 00 00 00 00 0C 01 00 00 00  ÿÿÿÿÿ...........
00000070  07 43 45 4C 61 62 65 6C 00 00 27 58 00 00 00 2D  .CELabel..'X...-
00000080  00 00 00 19 00 00 00 B4 00 00 00 32 00 0B 20 8B  .......´...2.. ‹
00000090  FF FF FF FF FF 00 00 00 00 00 00 0C 00 00 00 00  ÿÿÿÿÿ...........
000000A0  00 00 01 00 00 00 08 43 45 42 75 74 74 6F 6E 00  .......CEButton.
000000B0  00 27 59 00 00 00 3C 00 00 00 64 00 00 00 32 00  .'Y...<...d...2.
000000C0  00 00 14 1A A8 00 1B FF C0 C0 C0 FF 00 00 00 00  ....¨..ÿÀÀÀÿ....
000000D0  00 00 0C 00 00 00 03 4F 6B 00 00 00 01 00 00 00  .......Ok.......
000000E0  08 43 45 42 75 74 74 6F 6E 00 00 27 5A 00 00 00  .CEButton..'Z...
000000F0  73 00 00 00 64 00 00 00 32 00 00 00 14 22 A8 00  s...d...2...."¨.
00000100  1B FF C0 C0 C0 FF 00 00 00 00 00 00 0C 00 00 00  .ÿÀÀÀÿ..........
00000110  07 43 61 6E 63 65 6C 00 00 00 01 00 00 00 08 43  .Cancel........C
00000120  45 42 75 74 74 6F 6E 00 00 27 5B 00 00 00 AA 00  EButton..'[...ª.
00000130  00 00 64 00 00 00 32 00 00 00 14 02 A8 00 1B FF  ..d...2.....¨..ÿ
00000140  C0 C0 C0 FF 00 00 00 00 00 00 0C 00 00 00 06 52  ÀÀÀÿ...........R
00000150  65 74 72 79 00 00 00 00 00 00 00                 etry.......
Offset Length Example Name Notes
0x00 0x04 00 00 00 08 text_string_lenght Lenght of the next text string (in big endian)
0x04 0x08 CEDialog text_string CEDialog data type. Without the null termination !
0x0C 0x04 00 00 27 56 entry_id Unique ID, is the same type of ID than the ones at the index table
The ID of CEDialog (root of this hierarchy) is the only that appears duplicated in the index, the IDs of the childrens of CEDialog doesnt appears in the index table
0x10 0x04 00 00 00 00 unknown This one always increments. CERectComponent=0x0000000A, CELabel=0x0000002D, first CEbutton=0x0000003C, second CEbutton=0x00000073, third CEbutton=0x000000AA
0x14 0x04 00 00 00 00 unknown Always 0x00000064 for CEButton ?, CERectComponent=0x00000008, CELabel=0x00000019
0x18 0x04 00 00 01 09 unknown Always 0x00000032 for CEButton ?, CERectComponent=0x00000020, CELabel=0x000000B4
0x1C 0x04 00 00 00 55 unknown Always 0x00000014 for CEButton ?, CERectComponent=0x00000020, CELabel=0x00000032
0x20 0x01 00 unknown First CEbutton of the example = 0x1A, second=0x22, third=0x02. , CERectComponent=0x00, CELabel=0x00
0x21 0x01 01 unknown First CEbutton of the example = 0xA8, second=0xA8, third=0xA8. , CERectComponent=0x00, CELabel=0x0B
0x22 0x01 00 unknown Always 0x00 for CEButton ?, CERectComponent=0x00, CELabel=0x20
0x23 0x01 63 unknown Always 0x1B for CEButton ?, CERectComponent=0x83, CELabel=0x8B
0x24 0x04 FF C0 C0 C0 bg_color Background color (in #ABGR format ?)
0x28 0x04 FF 00 00 00 color Color (in #ABGR format ?)
0x2C 0x04 00 00 00 0C unknown
0x30 0x04 00 00 00 05 children_amount Number of "chidren" items under the root item CEDialog (in this example there are 5 childrens: CERectComponent, CELabel, CEButton, CEButton, CEButton)
0x34 0x01 01 read_next ? Always 1 ? (and 0 for the last entry). Indicates if there is an entry next (or a brother at the same level of the hierarchy) ?
0x35 All the previous values seems to be definitions of the root CEDialog. After them continues with the definitions of the first children of the hierarchy named CERectComponent... and so on...

For CEButton at 0x30

Offset Length Example Name Notes
0x30 0x04 00 00 00 03 text_string_lenght Lenght of the next text string + the null byte (in big endian)
0x34 varies Ok text_string Ok, Cancel, Retry, etc...
varies 0x01 00 null
varies 0x02 00 00 unknown Always zero ?
varies 0x01 01 unknown Always 1 ?

For CELabel at 0x30 (same than CEButton, but with a zero bytes lenght text string)

Offset Length Example Name Notes
0x30 0x04 00 00 00 00 text_string_lenght ?
varies 0x02 00 00 unknown Always zero ?
varies 0x01 01 unknown Always 1 ?

For CERectComponent at 0x30

Offset Length Example Name Notes
varies 0x01 01 unknown Always 1 ?
  • Notes:
    • The IDs of the hierarchy are:
      • 0x2756 (10070 in decimal) - CEDialog (root)
      • 0x2757 (10071 in decimal) - CERectComponent (first children)
      • 0x2758 (10072 in decimal) - CELabel (second children)
      • 0x2759 (10073 in decimal) - CEButton (third children) with the text Ok
      • 0x275A (10074 in decimal) - CEButton (fourth children) with the text Cancel
      • 0x275B (10075 in decimal) - CEButton (fifth children) with the text Retry
      • The ID of the root is the same of the index table (converted to decimal in the "SILKPADD editor" app to 10070), the IDs of the 5 childrens of 10070 doesnt appears on the index but are 10071, 10072, 10073, 10074, 10075. This is why the next CEDialog ID in the index inmediatly after 10070 is 100076 (because the IDs 10071 up to 10075 are used by the 5 childrens of 10070)
  • Some items found... (the list could be huge)
    • CERectComponent - Rectangled frame ?
    • CELabel - ?
    • CEButton - Displays a text string (and probably a button icon next to it). The 3 CEButtons of this example displays the text strings: Ok, Cancel, and Retry
    • etc...