letterbomb#

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

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

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

For additional usage, either:

  • view documentation on ReadTheDocs.

  • build and view the documentation located in the docs folder.

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 MIT license. You can obtain a copy at https://mit-license.org/.

Submodules#

Package Contents#

Functions#

mac_digest(→ bytes)

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

pack_blob(→ bytearray)

Pack blob with corresponding timestamps and the MAC digest.

sd_path(→ str)

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

serialize_mac(→ str)

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

timestamp(→ tuple[datetime.datetime, ...)

Return a tuple of timestamps.

validate_mac(→ bool)

Ensure mac is a valid Wii MAC address.

write(→ io.BytesIO | pathlib.Path)

Write LetterBomb archive.

exception letterbomb.MACEmulatedError(message: str = 'Bad MAC, you cannot use a MAC address from an emulator.')#

Bases: MACError

Raised when a MAC is of an emulator.

exception letterbomb.MACError(message: str = 'Bad MAC, does not belong to a Wii.')#

Bases: ValueError

Raised when a MAC does not belong to a Wii.

exception letterbomb.MACLengthError(message: str = 'Bad MAC, length should be 12 characters only.')#

Bases: MACError

Raised when a MAC is not 12 characters in length.

exception letterbomb.RegionError(message: str = 'Region must be one of U, E, J, K.')#

Bases: ValueError

Raised when region is not 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 x75x79x79, then digested.

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

Pack blob with corresponding timestamps and the MAC digest.

Parameters:
  • digest – MAC digest.

  • time_stamp – Unix epoch time.

  • blob – Blob content.

Returns:

Resulting blob content.

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 – MAC digest, see mac_digest()

  • deltatime – Time of letter receival.

  • time_stamp – Unix epoch time.

Returns:

String of resulting path, relative.

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:

A “:” split string.

letterbomb.timestamp() tuple[datetime.datetime, datetime.timedelta, int]#

Return a tuple of timestamps.

Returns:

Tuple of (date, delta from 2000/1/1, timestamp).

letterbomb.validate_mac(mac: str, oui_list: list[str]) bool#

Ensure mac is a valid Wii MAC address.

If MAC is valid, returns True.

Parameters:
  • mac – MAC address to validate.

  • oui_list – OUI list, not a path to an OUI file.

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:

True is MAC is valid.

letterbomb.write(mac: str, region: str, pack_bundle: bool = True, output_file: str | pathlib.Path | None = None) io.BytesIO | pathlib.Path#

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

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

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

  • If output_file is falsy, it will be ignored and the raw bytes are returned.

Parameters:
  • mac – Full string of the Wii’s MAC address.

  • region – Region of Wii, must be single letter of U,J,K,E.

  • pack_bundle – Pack the HackMii installer with archive.

  • output_file – File to write archive to, bytes are returned if empty.

Raises:
Returns:

BytesIO of ZIP archive, or file path of archive.