libWiiPy.title.wad Module#

The libWiiPy.title.wad module provides support for handling WAD (Wii Archive Data) files, which is the format used to deliver digital Wii titles. This module allows for extracting the various components for a WAD, as well as properly padding and writing out that data when it has been edited using other modules.

Module Contents#

class libWiiPy.title.wad.WAD#

Bases: object

A WAD object that allows for either loading and editing an existing WAD or creating a new WAD from raw data.

wad_type#

The type of WAD, either ib for boot2 or Is for normal installable WADs.

Type:

str

wad_cert_size#

The size of the WAD’s certificate.

Type:

int

wad_crl_size#

The size of the WAD’s crl.

Type:

int

wad_tik_size#

The size of the WAD’s Ticket.

Type:

int

wad_tmd_size#

The size of the WAD’s TMD.

Type:

int

wad_content_size#

The size of WAD’s total content region.

Type:

int

wad_meta_size#

The size of the WAD’s meta/footer.

Type:

int

dump() bytes#

Dumps the WAD object into the raw WAD file. This allows for creating a WAD file from the data contained in the WAD object.

Returns:

The full WAD file as bytes.

Return type:

bytes

get_cert_data() bytes#

Gets the certificate data from the WAD.

Returns:

The certificate data.

Return type:

bytes

get_content_data() bytes#

Gets the content of the WAD.

Returns:

The content data.

Return type:

bytes

get_crl_data() bytes#

Gets the crl data from the WAD, if it exists.

Returns:

The crl data.

Return type:

bytes

get_meta_data() bytes#

Gets the meta region of the WAD, which is typically unused.

Returns:

The meta region.

Return type:

bytes

get_ticket_data() bytes#

Gets the ticket data from the WAD.

Returns:

The ticket data.

Return type:

bytes

get_tmd_data() bytes#

Returns the TMD data from the WAD.

Returns:

The TMD data.

Return type:

bytes

get_wad_type() str#

Gets the type of the WAD.

Returns:

The type of the WAD. This is ‘Is’, unless the WAD contains boot2, where it is ‘ib’.

Return type:

str

load(wad_data: bytes) None#

Loads raw WAD data and sets all attributes of the WAD object. This allows for manipulating an already existing WAD file.

Parameters:

wad_data (bytes) – The data for the WAD file to load.

set_cert_data(cert_data) None#

Sets the certificate data of the WAD. Also calculates the new size.

Parameters:

cert_data (bytes) – The new certificate data.

set_content_data(content_data, size: int = None) None#

Sets the content data of the WAD. Also calculates the new size.

Parameters:
  • content_data (bytes) – The new content data.

  • size (int, option) – The size of the new content data.

set_crl_data(crl_data) None#

Sets the crl data of the WAD. Also calculates the new size.

Parameters:

crl_data (bytes) – The new crl data.

set_meta_data(meta_data) None#

Sets the meta data of the WAD. Also calculates the new size.

Parameters:

meta_data (bytes) – The new meta data.

set_ticket_data(tik_data) None#

Sets the Ticket data of the WAD. Also calculates the new size.

Parameters:

tik_data (bytes) – The new TMD data.

set_tmd_data(tmd_data) None#

Sets the TMD data of the WAD. Also calculates the new size.

Parameters:

tmd_data (bytes) – The new TMD data.