Difference between revisions of "WAD files"

From WiiBrew
Jump to: navigation, search
m
m (Reverted edits by Keyboard mouse (Talk) to last revision by Randomdude)
Line 1: Line 1:
 
:''This application is about Wii software packaging. For the data files used by Doom, see [[WiiDoom]].''
 
:''This application is about Wii software packaging. For the data files used by Doom, see [[WiiDoom]].''
: <div class="notice metadata plainlinks" id="stub">''This article is a [http://en.wikipedia.org/wiki/Wikipedia:Stub stub]. You can help {{SITENAME}} by [{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding it].''</div>[[Category:Stubs]]
 
 
==General info==
 
==General info==
 
The WAD file-format is a file-format that contains information for the wii, such as System Menus, IOSs, and Channels.  
 
The WAD file-format is a file-format that contains information for the wii, such as System Menus, IOSs, and Channels.  
Line 75: Line 74:
  
  
 +
{{stub}}
 
[[Category:Software]]
 
[[Category:Software]]
 
[[Category:File formats]]
 
[[Category:File formats]]

Revision as of 07:16, 6 July 2010

This application is about Wii software packaging. For the data files used by Doom, see WiiDoom.

General info

The WAD file-format is a file-format that contains information for the wii, such as System Menus, IOSs, and Channels.

Piracy

Unfortunately, WAD files are often used to distribute pirated channels (both Virtual Console and WiiWare), due to the fact that they are also used by Nintendo and therefore easy to rip from the Wii and, for some WAD files, Nintendo's servers, and easy to create installers for. Wiibrew does not in any way endorse piracy, and as such these uses of WAD files should not be discussed.

If you wish to discuss legitimate WAD files, please ensure you make clear which file you are talking about and what you will use it for, to prevent people jumping to conclusions about your intentions.

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 (APP) size
0x01C 0x01F 4 Footer size

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

The contents are stored in the WAD in the same order as in the TMD. Each file is aligned to 0x40 bytes.

The contents (Data section) 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 the hash that is stored in the TMD.

In a hex editor, the beginning of any WAD will be 00 00 00 20 49 73. This can be useful to remove a WAD from an ELF file.

Footer

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