Difference between revisions of "WAD files"

From WiiBrew
Jump to: navigation, search
(updated.)
Line 2: Line 2:
  
 
The data within a WAD file has the following format.
 
The data within a WAD file has the following format.
 
'''<span style="color: red;">This page is horribly out of date. Expect an update when the dust of recent events settles.</span>'''
 
 
'''<span style="color: red;">NOTE: Recently updated, should the certificate/ticket/TMD data be deleted?.</span>'''
 
  
 
Thanks to Segher for his [http://git.infradead.org/users/segher/wii.git?a=blob_plain;f=zeventig.c;hb=HEAD source].
 
Thanks to Segher for his [http://git.infradead.org/users/segher/wii.git?a=blob_plain;f=zeventig.c;hb=HEAD source].

Revision as of 00:30, 20 June 2008

WAD Format

The data within a WAD file has the following format.

Thanks to Segher for his source.

Header

Start End Length Description
0x000 0x003 4 Header size = 0x0020
0x004 0x007 4 WAD Type ('Is\0\0' or 'ib\0\0' or 'Bk\0\0')
0x008 0x00B 4 Certificate chain size.
0x00C 0x00F 4 Reserved = 0
0x010 0x013 4 Ticket size
0x014 0x017 4 TMD size
0x018 0x01B 4 data size
0x01C 0x01F 4 Footer size

The contents are stored in the WAD in the same order as in the TMD. Each block (header, contents) is aligned to 0x40 bytes.

The contents are encrypted using the title key (decrypt it from the ticket) and the content index (in the TMD, the 2 first bytes of the IV are the index, the last 14 bytes are zeroes) as IV. The SHA1 of the decrypted content must match that stored in the TMD.

Footer

The "footer" is an optional, unencrypted timestamp / buildstamp.