Libwiipy

Latest version: v0.5.2

Safety actively analyzes 688803 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.5.2

This is a quick hotfix for the v0.5.x release series that reverts some changes from v0.5.0 that ended up causing more problems than they fixed, and have been replaced with a new and much simpler fix. It also adds basic support for handling development signed/encrypted WADs.

Changelog:

Content
- Reverted changes to how content indices were processed. In v0.5.0, all methods for `ContentRegion()`s that took an index as a parameter were changed to resolve that index by finding the content record that contained it and then using that, rather than just going to the literal position of that index in order. This change was made to fix support for WADs where the index of the content in the record didn't match the literal index, but introduced issues related to getting/decrypting content as well as setting/encrypting it.
- As a replacement for the complicated and ultimately problematic solution referenced above, methods in `ContentRegion()`s that take indices will now resolve to the literal index again, but will still resolve to the content index when required for decryption. This fixes the same issue without introducing behavior different from the v0.4.x API.

Title Parsing and Editing
- The `get_common_key()` method now accepts the kwarg `dev`, which when set to True will cause the method to return the development Wii Common Key instead of the retail one when key 0 is requested. Keys 1 and 2 are unaffected by this argument.
- The crypto methods `encrypt_title_key()` and `decrypt_title_key()` now accept the kward `dev`, which when set to True will cause them to pass that True along to `get_common_key()`, allowing them to successfully decrypt the Title Key of a development title.
- The signature issuer of a Ticket is now parsed during load, and the new `Ticket()` property `is_dev` will be set to True if the signature issuer is the one used for development titles.
- The `Ticket()` method `get_title_key()` and the `Title()` method `set_title_id()` now pass the new `Ticket` property `is_dev` along to `decrypt_title_key()` and `set_title_id()`, respectively, to allow for proper support of development titles across the library.
- Combined, these features allow for seamless decryption of content from development titles with **no** explicit intervention required under typical use.

Remember, we have API documentation! It's automagically generated from the docstrings, so it's always pretty up to date. You can go check it out [here](https://ninjacheetah.github.io/libWiiPy).

This release is also available [on PyPI](https://pypi.org/project/libWiiPy/0.5.2/).

0.5.1

Hey there, it's been a little while! This release pushes out fixes for some bugs that were found recently while I worked on WiiPy, and adds a couple new features as well.

Changelog:

General
- The NAND-related modules `emunand` and `sys` have been moved under a new `nand` subpackage. You will now need to reference them using the `libWiiPy.nand` prefix instead of `libWiiPy.title`. An overview of this new subpackage can be found [in the API documentation](https://ninjacheetah.dev/libWiiPy/libWiiPy.nand.html).

Title Parsing and Editing
- TMD regions have been changed to the more correct region code system, rather than returning the full names of the regions. These codes are as follows: `USA`, `EUR`, `JPN`, and `KOR`.
- The `Title()` class now offers `get_title_size()` and `get_title_size_blocks()` to get the size of the entire title in either bytes or blocks, respectively. Both methods accept the kwarg `absolute` to determine whether shared content should be included in the total or not.
- Title types are now returned correctly from the `TMD()` class' `get_title_type()` method. This previously read an incorrect field in the TMD and would always return `System` regardless of the actual type.
- Adding new content to an existing title now works as expected. Previously, the `num_contents` property of the TMD was not updated, so content added beyond the original count would not be saved when dumping a WAD.
- `ContentRegion()` now offers `remove_content_by_index()` and `remove_content_by_cid()` to remove a specified content from a title.
- `Title()` now offers `add_content()` and `add_enc_content()` so that you do not have to interface with the underlying `ContentRegion()` directly to add new content to a title.
- `ContentRegion()` now offers the method `get_index_from_cid()` to resolve a content index from a Content ID.

New Class: SettingTxt
- New class for handling the `setting.txt` file used by the System Menu to store your console's region and serial number.
- Allows for parsing `setting.txt` by decrypting it and loading the keys, allowing you to edit them, and for re-encrypting the file for use on a console.


Remember, we have API documentation! It's automagically generated from the docstrings, so it's always pretty up to date. You can go check it out [here](https://ninjacheetah.github.io/libWiiPy).

This release is also available [on PyPI](https://pypi.org/project/libWiiPy/0.5.1/).

0.5.0

This release was originally scheduled to be minor release v0.4.2, but so many new features were added along the way that it really deserves a major version number increase. Enough is happening, in fact, that I'm breaking up these release notes by module.

Changelog:

General
- The TMD, Ticket, and Title classes now all offer `get_is_fakesigned()` to check whether the loaded TMD and/or Ticket is fakesigned. For a Title, this checks both the TMD and Ticket and only returns True if they are both fakesigned.
- Content records with content indices that don't match the literal index of the record are now handled correctly on the dumping side. The loading side was already working as expected.
- The TMD, Ticket, and Title classes now all offer `set_title_version()` to correctly set a new version number. For a Title, this sets the version in both the TMD and Ticket.
- `get_common_key()` now falls back on key 0 (the normal common key) instead of raising an exception when an invalid key index is supplied. This fixes handling tickets with strange values set as the key index.
- Fixed a case where a Title ID formatted in a certain way would not be converted properly to an IV during Title Key decryption.
- The footer is now read from/written to the correct portion of a WAD. Y'know, the foot. Where it always should've been.
- The title version can be converted to a friendlier format (vX.X) for supported titles. This mostly only produces useful results for the System Menu, whose values are hard-coded, IOS, and most first-party downloadable channels.
- U8 archives are now all extracted properly, and packing is much closer to official Nintendo-made U8 archives.

New Class: SharedContentMap
- New class for handling the `content.map` file used by the Wii to manage shared content.
- Allows for parsing an existing map, initializing a new one, and adding entries.
- New entries return the shared content ID that was assigned to them when added.

New Class: IOSPatcher
- New class for applying patches to loaded IOS Title objects.
- Currently supported stable patches include: `patch_fakesigning()`, `patch_es_identify()`, `patch_nand_access()`, and `patch_version_downgrading()`. More can be read about these patches in the API documentation, though they are the same as patches done by legacy tools.
- Experimental patch for disabling querying the disc drive, mostly for vWii users without a drive installed. This patch is still a work in progress and may cause unexpected side effects on some setups. This patch is **not** included in `patch_all()`.

New Class: EmuNAND
- New class for creating and managing EmuNANDs.
- Currently only supports installing titles to an EmuNAND and removing installed titles.
- Not currently complete enough to create a fresh, working EmuNAND, but it can safely modify an existing one, and creates enough data that you can install WADs to a blank folder with it and give it to Dolphin and it can fill in the gaps to boot it.

New Class: UidSys
- New class for handling the `uid.sys` file used by the Wii to track all titles ever present on the console.
- Allows for parsing an existing file, initializing a new one, and adding new entries.
- New entries return the UID assigned to them when added.

Content
- Much of the ContentRegion class was rewritten from scratch, providing much more clarity. This is also represented in the improved docstrings and API documentation generated from them.
- The ContentRegion class now entirely relies on the true content indices specified in the content records. This means that getting or setting a certain index may actually be changing a different index than expected, because the content index of the record there differs from the index of the record. This should not matter in most cases.
- Distinctions between `load_content()`/`add_content()`/`set_content()` and their encrypted counterparts are now much clearer.
- Get methods now support skipping the hash checks for decryption. This will print out a warning if the check failed that it is being ignored. This behavior cannot be changed.

Title
- A major bug was fixed where edited content records weren't being copied from the ContentRegion (where they were being edited) to the TMD before dumping a WAD.
- The Title Key will now be properly re-encrypted when setting the Title ID in a Title object.
- Added `get_title_size()` and `get_title_size_blocks()` to get the installed size of the title in bytes and blocks, respectively.

TMD
- A TMD's `access_rights` property is now properly stored as an integer.
- TMDs now offer the `AccessFlags` enum that defines the bits used to determine and set access rights. Current values are `DVD_VIDEO` and `AHB`.
- New method `get_access_right()` that takes a bit to check and returns True/False based on if that bit is enabled or not. Recommended to be used alongside `AccessFlags`.
- Title types and content types are now handled properly. This does not impact `get_title_type()` as it only changed the backend for it and not the return values. For getting the content type, you now must use `get_content_type()` and specify the content index that you want the type of.

There have also likely been many more minor fixes here and there that I have forgotten about. No other API changes should have occurred, beyond the ones explicitly listed above.

Remember, we have API documentation! It's automagically generated from the docstrings, so it's always pretty up to date. You can go check it out [here](https://ninjacheetah.github.io/libWiiPy).

This release is also available [on PyPI](https://pypi.org/project/libWiiPy/0.5.0/).

0.4.1

Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience.

Changelog:
- The `tmd` and `ticket` modules now offer a `fakesign()` method, that will fakesign the object it is being used on in-place. You can then dump the TMD or Ticket back into data after using this method, and the resulting file will be fakesigned.
- The `title` module now offers `fakesign()` as well to automatically fakesign the TMD and Ticket of the loaded title. You can then dump the title to a WAD, and it will be fakesigned and installable with any IOS vulnerable to the trucha bug.
- Added code to the `tmd` module to load/dump the minor version key to or from a TMD, which was previously ignored as it goes totally unused. This was needed for fakesigning support.
- Fixed the way some title versions were handled in the `tmd` module, namely the Wii Menu. Versions converted to vX.X format would sometimes not convert back to vXXX format correctly.

Known Issues:
- There are some known issues with the `u8` module, meaning that some U8 archives may not extract correctly. This is being looked into and will hopefully be fixed soon.

This release is also available [on PyPI](https://pypi.org/project/libWiiPy/0.4.1/).

0.4.0

Changelog:
- Added new `ash` module to handle decompressing ASH files (both the common variant in the Wii Menu and games like Animal Crossing: City Folk, and also the other variant found in My Pokémon Ranch)
- New function `decompress_ash()` to decompress an ASH file, part of the `libWiiPy.archive` subpackage
- Many functions and classes that were previously public have been made private, as they were not designed for general use and could be confusing when they were automatically imported
- U8 archives can now be extracted to an existing **empty** directory (as opposed to the previous behavior of requiring the target directory to not already exist)
- The components of a TMD's signature (the type, the signature itself, and the padding afterwards) have all been separated out, which matches how Tickets have always handled these properties
- Fixed a major bug where IOS WADs made using legacy tools (NUS Downloader, Sharpii, etc.) could not be extracted by libWiiPy
- Fixed a bug where the content region size in the WAD header of IOS WADs would be calculated incorrectly, creating WADs that could not be extracted properly (this also guarantees consistency with WADs created using legacy tools)

During the development of libWiiPy v0.4.0, work also began on a documentation website! It's still a work in progress at this point, but you can take a look at our existing guides and API docs here: [https://ninjacheetah.github.io/libWiiPy/](https://ninjacheetah.github.io/libWiiPy/).

This release is also available [on PyPI](https://pypi.org/project/libWiiPy/0.4.0/).

0.3.1

Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience.

Changelog:
- `pack_u8()` now raises a `FileNotFound` error if the input path doesn't match the file or directory check. Previously, this function would silently fail and do nothing if the input path was invalid, with no indication that the file or directory was not found.

See the release notes for libWiiPy v0.3.0 for more info about what's new.

This release is also available [on PyPI](https://pypi.org/project/libWiiPy/0.3.1/).

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.