API Docs

Modules

✉️💣 LetterBomb: A fork of the classic Wii hacking tool from fail0verflow.

██╗     ███████╗████████╗████████╗███████╗██████╗ ██████╗  ██████╗ ███╗   ███╗██████╗
██║     ██╔════╝╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔══██╗
██║     █████╗     ██║      ██║   █████╗  ██████╔╝██████╔╝██║   ██║██╔████╔██║██████╔╝
██║     ██╔══╝     ██║      ██║   ██╔══╝  ██╔══██╗██╔══██╗██║   ██║██║╚██╔╝██║██╔══██╗
███████╗███████╗   ██║      ██║   ███████╗██║  ██║██████╔╝╚██████╔╝██║ ╚═╝ ██║██████╔╝
╚══════╝╚══════╝   ╚═╝      ╚═╝   ╚══════╝╚═╝  ╚═╝╚═════╝  ╚═════╝ ╚═╝     ╚═╝╚═════╝

For most usage, you should be using write_zip().

For additional usage, either:

If you downloaded this package from PyPi, the docs folder is not included.

Obtain the latest copy of LetterBomb here: https://gitlab.com/whoatemybutter/letterbomb

Note: This exploit only works for System Menu 4.3. 4.2 and below will not work.

LetterBomb is licensed under the GPLv3+ license. You can grab a copy here: https://www.gnu.org/licenses/gpl-3.0.txt.

exception letterbomb.BadLengthMACError(message='bad mac, length should be 12 characters only')

Bases: ValueError

Raised when a MAC is not 12 characters in length.

exception letterbomb.EmulatedMACError(message='bad mac, you cannot use a mac address from an emulator')

Bases: ValueError

Raised when a MAC is of an emulator.

exception letterbomb.InvalidMACError(message='bad mac, does not belong to a Wii')

Bases: ValueError

Raised when a MAC does not belong to a Wii.

exception letterbomb.InvalidRegionError(message='region must be one of U, E, K, J')

Bases: ValueError

Raised when region is a valid region character.

letterbomb.mac_digest(mac: str) bytes

Process mac through a SHA1 encoding with ‘\x75\x79\x79’ added.

Parameters

mac (str) – MAC address to digest

Returns

SHA-1 hash of MAC, plus \x75\x79\x79, then digested

Return type

bytes

letterbomb.pack_blob(digest: bytes, time_stamp: int, blob: bytearray) bytearray

Pack blob with corresponding timestamps and the MAC digest.

Parameters
  • digest (bytes) – MAC digest

  • time_stamp (int) – Unix epoch time

  • blob (bytearray) – Blob content

Returns

Resulting blob content

Return type

bytearray

letterbomb.sd_path(digest: bytes, deltatime: datetime.datetime, time_stamp: int) str

Return the path of the LetterBomb, relative to the root of the SD card.

Parameters
  • digest (bytes) – MAC digest, see mac_digest()

  • deltatime (datetime) – Time of letter receival

  • time_stamp (int) – Unix epoch time

Returns

String of resulting path, relative

Return type

str

letterbomb.serialize_mac(mac: str) str

Return mac as a string, each field split by a “:”.

Padded with zeros to two-lengths.

Parameters

mac (str) – MAC address

Returns

“:” split string

Return type

str

letterbomb.timestamp() list

Return a list of timestamps.

Returns

List of [deltatime, delta, timestamp]

Return type

list

letterbomb.validate_mac(mac: str, oui_list: list) int

Ensure mac is a valid Wii MAC address.

If MAC is valid, returns :int:`0`

Parameters
  • oui_list (list) – OUI list, not a path to a OUI file

  • mac (str) – MAC address to validate

Raises
  • BadLengthMACError – if MAC is not the proper length

  • EmulatedMACError – if MAC is from an emulator

  • InvalidMACError – if MAC does not belong to a Wii

Returns

0 if MAC is valid

Return type

int

letterbomb.write()

Write LetterBomb archive. Depending on use_io, archive bytes may be returned.

Depending upon the region, different LetterBomb templates will be used.

  • If pack_bundle is True, the BootMii installer will be included with the archive.

  • If output_file is “” or None, output_file will be ignored and instead, the raw bytes of

the archive will be returned.

Parameters
  • mac (str) – Full string of the Wii’s MAC address

  • region (str) – Region of Wii, must be single letter of U,J,K,E

  • pack_bundle (bool) – Pack the BootMii installer with archive

  • output_file (str,pathlib.Path,None) – File to write archive to, bytes are returned if empty

Raises
  • BadLengthMACError – if MAC is not the proper length

  • EmulatedMACError – if MAC is from an emulator

  • InvalidMACError – if MAC does not belong to a Wii

Returns

Bytes IO of ZIP archive, or resulting file path of archive

Return type

io.BytesIO or pathlib.Path