SILKPADD: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
Line 342: Line 342:
| ''varies'' || 0x02 || H || '''key_shorcut''' || Keyboard shorcut (in this example "H" for "Help")
| ''varies'' || 0x02 || H || '''key_shorcut''' || Keyboard shorcut (in this example "H" for "Help")
|-
|-
| ''varies''|| 0x02 || 00 01 || ''unknown'' ||  
| ''varies''|| 0x02 || 00 01 || ''navbar_position'' ? || This value seems to indicate the Menu location on the web browser navigation bar, some examples found:<br>0x1=Help<br>0x2=Bookmarks<br>0x4=Tools<br>0x7=Edit<br>0x9=Debug<br>0xD=View
|-
|-
| ''varies''|| 0x02 || 00 01 || ''unknown'' ||  
| ''varies''|| 0x02 || 00 01 || ''unknown'' || children count ?
|}
|}



Revision as of 06:18, 10 October 2018

Description

  • SILKPADD Is a container format used by the Silk Web Browser. The meaning of the name "PADD" is unknown, some speculations: Program ADDresses ?... or... PAD Data ?
  • Silkpadd files are located in paths:
    • dev_flash/vsh/resource/silk/data/CEFramework.bin
    • dev_flash/vsh/resource/silk/data/CEHtmlApi.bin
    • dev_flash/vsh/resource/silk/data/CEHtmlUI.bin
    • dev_flash/vsh/resource/silk/data/CEPhWeb.bin
    • dev_flash/vsh/resource/silk/data/CEHtmlBrowserApp.bin (removed/replaced in firmware 2.20)
    • dev_flash/vsh/resource/silk/data/CEHtmlBrowserAppXaiWidget.bin (removed/replaced in firmware 2.20)
    • dev_flash/vsh/resource/silk_nas/data/CEFramework.bin
    • dev_flash/vsh/resource/silk_nas/data/CEHtmlApi.bin
    • dev_flash/vsh/resource/silk_nas/data/CEHtmlUI.bin
    • dev_flash/vsh/resource/silk_nas/data/CEPhWeb.bin
    • dev_flash/vsh/resource/silk_webkit/data/CEFramework.bin
    • dev_flash/vsh/resource/silk_webkit/data/CEHtmlApi.bin
    • dev_flash/vsh/resource/silk_webkit/data/CEHtmlUI.bin
    • dev_flash/vsh/resource/silk_webkit/data/webcoreapp.bin

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 SILK silk_signature By now this is represented in wiki as two separated signatures just incase the format allows for other variants, like SILKFLAT, SILKPLUS, etc... but maybe the 8 bytes are a single signature
0x04 0x04 PADD padd_signature
0x08 0x02 00 00 hdr_unk2 Always zeroes ?
0x0A 0x02 0C 00 entry_count Number of entries in the file (l.e.)
0x0C 0x04 00 00 00 00 hdr_unk4 Always zeroes ?

Index table

The index table starts at offset 0x10, every entry in the index table is 0xC bytes length 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 data_id A unique ID for the data, used by the web browser to identify and to access the data (l.e.)
0x04 0x04 A0 00 00 00 data_offset Absolute offset of the data (l.e.)
0x08 0x04 9B 00 00 00 data_length Size of the data (l.e.)

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 length 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_length=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_length Length of the next text string + 1 null byte at the end (b.e.)
0x04 varies Test 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_length Size of the HTML file + 1 null byte at the end (b.e.)
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 data_type_length Length of the next text string (b.e.)
0x04 0x08 CEBinary data_type CEBinary data type. Without the null termination !
0x0C 0x02 00 00 bin_unk2 Always zeroes ?
0x0E 0x04 00 00 00 09 file_type_length Length of the next text string (b.e.)
0x12 varies image\gif file_type 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_legth Indicates the size of the file (b.e.)
varies varies GIF, etc... file_data This is the file
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 of the same type than the ones at the index table. The ID of CEDialog (root of this hierarchy) is the only that appears duplicated in the index table, the IDs of the children of CEDialog doesnt appears in the index table

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 data_type_length Length of the next text string (b.e.)
0x04 0x08 CEDialog data_type CEDialog data type. Without the null termination !
0x0C 0x02 00 00 unknown Always zero for CEDialog ?
0x0E 0x02 27 56 data_id Unique ID (b.e.)
0x10 0x04 00 00 00 00 unknown Other examples: CERectComponent=0x0A, CELabel=0x2D, CEbutton(1)=0x3C, CEbutton(2)=0x73, CEbutton(3)=0xAA
0x14 0x04 00 00 00 00 unknown Other examples: CERectComponent=0x08, CELabel=0x19, CEbutton(1,2,3)=0x64
0x18 0x04 00 00 01 09 unknown Other examples: CERectComponent=0x20, CELabel=0xB4, CEbutton(1,2,3)=0x32
0x1C 0x04 00 00 00 55 unknown Other examples: CERectComponent=0x20, CELabel=0x32, CEbutton(1,2,3)=0x14
0x20 0x01 00 unknown Other examples: CERectComponent=0x00, CELabel=0x00, CEbutton(1)=0x1A, CEbutton(2)=0x22, CEbutton(3)=0x02
0x21 0x01 01 unknown Other examples: CERectComponent=0x00, CELabel=0x0B, CEbutton(1,2,3)=0xA8
0x22 0x01 00 unknown Other examples: CERectComponent=0x00, CELabel=0x20, CEbutton(1,2,3)=0x00
0x23 0x01 63 unknown Other examples: CERectComponent=0x83, CELabel=0x8B, CEbutton(1,2,3)=0x1B
0x24 0x04 FF C0 C0 C0 bg_color Background color (in #ARGB format?, or #ABGR format ?)
0x28 0x04 FF 00 00 00 color Color (in #ARGB format?, or #ABGR format ?)
0x2C 0x04 00 00 00 0C unknown Font size ?

The values above seems to be commonly used by all the "items" of the hierarchy, after them (at relative offset 0x30) appears other values that are specific for each "item"

For CEDialog at 0x30

Offset Length Example Name Notes
0x30 0x04 00 00 00 05 children_count Number of chidrens under the root CEDialog (in this example there are 5 children: 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) ?

For CERectComponent at 0x30

Offset Length Example Name Notes
0x30 0x01 01 read_next ?

For CELabel at 0x30 (same than CEButton, but in this example without the text string)

Offset Length Example Name Notes
0x30 0x04 00 00 00 00 text_string_length ?
0x34 0x02 00 00 key_shorcut ? Always zero for CELabel ?
0x36 0x01 01 read_next ?

For CEButton at 0x30

Offset Length Example Name Notes
0x30 0x04 00 00 00 03 text_string_length Length of the next text string + the null byte (b.e.)
0x34 varies Ok text_string Ok, Cancel, Retry, etc...
varies 0x01 00 null
varies 0x02 00 00 key_shorcut ? Always zero for CEButton ?
varies 0x01 01 read_next ?
  • 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)
CEMenu

The CEMenu is a complex data type that represents the root of a hierarchy of parent/chidren/brothers. Every one of them have an unique ID

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

00000000  00 00 00 06 43 45 4D 65 6E 75 00 00 75 BA 00 00  ....CEMenu..uº..
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 32  ...............2
00000020  04 0B FF FF FF FF FF 00 00 00 00 00 00 0C 00 00  ..ÿÿÿÿÿ.........
00000030  00 05 48 65 6C 70 00 00 48 00 01 00 01 75 BB 00  ..Help..H....u».
00000040  00 00 06 41 62 6F 75 74 00 00 00 00 00 00 41 00  ...About......A.

First appears the same values than the ones used in CEDialog, and after them (at relative offset 0x2E)

Offset Length Example Name Notes
0x2E 0x04 00 00 00 05 text_string_length
0x32 varies Help text_string
varies 0x01 00 null
varies 0x02 H key_shorcut Keyboard shorcut (in this example "H" for "Help")
varies 0x02 00 01 navbar_position ? This value seems to indicate the Menu location on the web browser navigation bar, some examples found:
0x1=Help
0x2=Bookmarks
0x4=Tools
0x7=Edit
0x9=Debug
0xD=View
varies 0x02 00 01 unknown children count ?
Offset Length Example Name Notes
varies 0x02 75 BB data_id Weird, this ID is pointing to a problem of how is splitted the CEDialog/CEMenu structure in this wiki page
varies 0x04 00 00 00 06 text_string_length
varies varies About text_string
varies 0x01 00 null
varies 0x02 00 00 unknown
varies 0x02 00 00 unknown
varies 0x02 A key_shorcut Keyboard shorcut (in this example "A" for "About")
varies 0x01 00 read_next ?

Links and Tools