Line 4:
Line 4:
== File structure ==
== File structure ==
+
=== v0 ticket ===
+
This part of the ticket is included in both v0 and v1 tickets.
+
{| class="wikitable"
{| class="wikitable"
|-
|-
−
! Start
+
! Absolute start
−
! End
+
! Absolute end
! Length
! Length
! Description
! Description
Line 134:
Line 137:
To get the title key decrypt the 16 bytes at offset 0x1bf with the Common Key using the Title ID (offset 0x1dc) as the initialization vector (the last 8 bytes of the IV should be zero).
To get the title key decrypt the 16 bytes at offset 0x1bf with the Common Key using the Title ID (offset 0x1dc) as the initialization vector (the last 8 bytes of the IV should be zero).
+
+
=== v1 ticket ===
+
This part is only present in v1 tickets (stored as .tv1 files in the [[Hardware/NAND|NAND]]). All offsets are relative to the beginning of the v0 ticket.
+
+
==== Ticket header ====
+
{| class="wikitable"
+
|-
+
! Absolute start
+
! Absolute end
+
! Length
+
! Description
+
|-
+
| 0x02A4
+
| 0x02A5
+
| 2
+
| Version of the v1 ticket header
+
|-
+
| 0x02A6
+
| 0x02A7
+
| 2
+
| Size of the v1 ticket header
+
|-
+
| 0x02A8
+
| 0x02AB
+
| 4
+
| Size of the v1 ticket (0x14?)
+
|-
+
| 0x02AC
+
| 0x02AF
+
| 4
+
| Offset to the section headers
+
|-
+
| 0x02B0
+
| 0x02B1
+
| 2
+
| Number of section headers
+
|-
+
| 0x02B2
+
| 0x02B3
+
| 2
+
| Size of each section header (0x14?)
+
|-
+
| 0x02B4
+
| 0x02B7
+
| 4
+
| Miscellaneous flags
+
|}
+
+
==== Section header ====
+
{| class="wikitable"
+
|-
+
! Start
+
! End
+
! Length
+
! Description
+
|-
+
| 0x00
+
| 0x03
+
| 4
+
| Offset to the records
+
|-
+
| 0x04
+
| 0x07
+
| 4
+
| Number of records
+
|-
+
| 0x08
+
| 0x0B
+
| 4
+
| Size of each record in this section
+
|-
+
| 0x0C
+
| 0x0F
+
| 4
+
| Size of the section
+
|-
+
| 0x10
+
| 0x11
+
| 2
+
| Section type
+
|-
+
| 0x12
+
| 0x13
+
| 2
+
| Miscellaneous flags
+
|}
[[Category:File formats]]
[[Category:File formats]]