|
|
Line 129: |
Line 129: |
| == BDRI == | | == BDRI == |
|
| |
|
| Information stored about titles in these Title Database files are stored in two parts in a BDRI partition. Firstly in a Title Entry Table, and secondly in a Title Info Table.
| | This is a variant of [[Inner FAT|FAT filesystem]]. It consists one "root" directory and multiple "files". Each "file" is one title info entry described below. |
|
| |
|
| {| class="wikitable"
| | == Title Info Entry == |
| |-
| |
| ! Start
| |
| ! Length
| |
| ! Description
| |
| |-
| |
| | 0x0
| |
| | 4
| |
| | Database Magic ("BDRI")
| |
| |-
| |
| | 0x4
| |
| | 4
| |
| | File Format Version (0x30000)
| |
| |-
| |
| | 0x8
| |
| | 8
| |
| | Unknown
| |
| |-
| |
| | 0x10
| |
| | 8
| |
| | File Size (including pre header), in blocks (see next field)
| |
| |-
| |
| | 0x18
| |
| | 4
| |
| | Block Size (Usually 0x80; 0x200 for ticket.db)
| |
| |-
| |
| | 0x1C
| |
| | 4
| |
| | Reserved
| |
| |-
| |
| | 0x20
| |
| | 0x20
| |
| | Unknown/Constant
| |
| |-
| |
| | 0x40
| |
| | 0x18
| |
| | Unknown
| |
| |-
| |
| | 0x58
| |
| | 8
| |
| | Relative Title Entry Table Offset
| |
| |-
| |
| | 0x60
| |
| | 0x20
| |
| | Unknown
| |
| |}
| |
|
| |
|
| == Title Entry Table ==
| | An entry contains information taken from both the application NCCH file(s) and TMD. |
| | |
| This contains 'Entries' for all the titles stored in the database. However this just appears to be an indexing table, the majority of title information is kept in a Title Info Table, which these index entries point to. Title Entries start immediately after the Title Entry Table Header. And there is no padding between entries.
| |
| | |
| === Header ===
| |
| | |
| {| class="wikitable"
| |
| |-
| |
| ! Start
| |
| ! Length
| |
| ! Description
| |
| |-
| |
| | 0x0
| |
| | 4
| |
| | Unknown/Magic? (usually = 0x2)
| |
| |-
| |
| | 0x4
| |
| | 4
| |
| | Unknown/Magic? (usually = 0x3)
| |
| |-
| |
| | 0x8
| |
| | 0x24
| |
| | Reserved
| |
| |-
| |
| | 0x2C
| |
| | 4
| |
| | Number of used Title Entries
| |
| |-
| |
| | 0x30
| |
| | X - 0x30
| |
| | Alignment padding for X = BDRI Block Size
| |
| |-
| |
| | X
| |
| | 4
| |
| | MAX Number of Title Entries
| |
| |-
| |
| | X + 0x04
| |
| | 4
| |
| | Unknown
| |
| |-
| |
| | X + 0x08
| |
| | 0x20
| |
| | Reserved
| |
| |}
| |
| | |
| === Title Entry Format ===
| |
| | |
| The entries are 0x2C bytes long.
| |
| | |
| {| class="wikitable"
| |
| |-
| |
| ! Start
| |
| ! Length
| |
| ! Description
| |
| ! ticket.db only
| |
| |-
| |
| | 0x0
| |
| | 4
| |
| | Unknown
| |
| | Unknown (0)
| |
| |-
| |
| | 0x4
| |
| | 4
| |
| | Active Flag. If this isn't = 0x1, then this entry slot is unused
| |
| | same
| |
| |-
| |
| | 0x8
| |
| | 0x8
| |
| | Title ID
| |
| | same
| |
| |-
| |
| | 0x10
| |
| | 4
| |
| | Title Entry Index
| |
| | same
| |
| |-
| |
| | 0x14
| |
| | 4
| |
| | Relative Title Info Offset, in blocks (see next field)
| |
| | Unknown
| |
| |-
| |
| | 0x18
| |
| | 0x4
| |
| | Block Size (Usually 0x80; 0x200 for ticket.db)
| |
| | Relative Title Info Offset, in BDRI blocks
| |
| |-
| |
| | 0x1c
| |
| | 4
| |
| | Reserved
| |
| | Title Info size, in bytes
| |
| |-
| |
| | 0x20
| |
| | 4
| |
| | Unknown, occasionally this value is the title's "Title ID lower"
| |
| | Unknown (0)
| |
| |-
| |
| | 0x24
| |
| | 0x4
| |
| | Unknown
| |
| | same
| |
| |-
| |
| | 0x28
| |
| | 0x4
| |
| | Unknown
| |
| | same
| |
| |}
| |
| | |
| * The actual Title Info offset is calculated by the following: Offset of BDRI Header + Relative Offset of Title Entry Table + Relative Title Info Offset
| |
| | |
| == Title Info Table ==
| |
| | |
| These consist of 0x80 byte long entries, pointed to by the title index entries. They contain information taken from both the application NCCH file(s) and TMD.
| |
|
| |
|
| {| class="wikitable" | | {| class="wikitable" |