Line 125:
Line 125:
=== Key and IV ===
=== Key and IV ===
−
'''<span style="color: red;">It's recommended to read the [[ticket|Ticket]] article and using the header information instead of that info and constant offsets.</span>'''
+
'''<span style="color: red;">It's recommended to read the [[Ticket|ticket]] article and using the header information instead of that info and constant offsets.</span>'''
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;"
{| style="border-collapse: collapse; padding: 0.2em 0.2em 0.2em 0.2em;"
Line 151:
Line 151:
=== File Table ===
=== File Table ===
−
'''<span style="color: red;">It's recommended to read the [[TMD|Tmd file structure]] article and using the header information instead of that info and constant offsets.</span>'''
+
'''<span style="color: red;">It's recommended to read the [[Tmd file structure|TMD]] article and using the header information instead of that info and constant offsets.</span>'''
WAD files contain a number of "files" in them. The number of files can be obtained from the halfword (2 bytes) at 0xede. The table itself starts at 0xee4, and it is composed of a number of file entries:
WAD files contain a number of "files" in them. The number of files can be obtained from the halfword (2 bytes) at 0xede. The table itself starts at 0xee4, and it is composed of a number of file entries:
Line 196:
Line 196:
=== APP ===
=== APP ===
−
The "APP" block in the WAD is a block of encrypted data that contains the info that is actually used by the channel.
+
The "APP" block in the WAD is a block of encrypted data that contains the info that is actually used.
The contents in the APP are referenced by the TMD content table. The APP is aligned to 64 bytes after each file.
The contents in the APP are referenced by the TMD content table. The APP is aligned to 64 bytes after each file.
−
The files are encrypted using the title key (decrypt it from the [[ticket]]) and the file index (in the TMD, the 2 first bytes of the IV are the index, the last 14 bytes are zeroes) as IV.
+
The files are encrypted using the title key (decrypt it from the [[Ticket|ticket]]) and the file index (in the TMD, the 2 first bytes of the IV are the index, the last 14 bytes are zeroes) as IV.
=== Trailer ===
=== Trailer ===
−
The "trailer" is a copy of the first file in the APP.
+
The "trailer" is a copy of the first file in the APP section. It's unencrypted.