Releases: NinjaCheetah/libWiiPy
v0.6.0: Banner Parsing and LZ77 Support
It's been a couple of months since the last release, and some new features were pretty much ready to go, so I figured I'd get them out.
Changelog:
General Title Changes
- The Title ID of a TMD and Ticket no longer have to match their data to be successfully loaded into a Title. This configuration is still invalid, but loading this data may be required to correct it.
- When downloading anything from the NUS, you can now specify a value for the kwarg
endpoint_override, which will allow using an external endpoint. Setting this value will causewiiu_endpointto be ignored. Note that at this time, there is no validation done for provided override URLs. - Added
get_content_size()andget_content_size_blocks()to the TMD class, allowing you to get the size of the content listed in its content records. Like the related methods for getting a Title's size, these methods accept the kwargabsolutethat determines whether shared content should be included in the totals or not. - The
title_idproperty of a Ticket will now be stored as raw bytes instead of ASCII bytes, which is a more appropriate format. This may cause issues if you read this property directly, however this change will have no effect on library functions.
EmuNAND
- Added
get_installed_titles()to get an index of all titles currently installed to an EmuNAND. - Added
get_title_tmd()andget_title_ticket()to get the TMD and Ticket of an installed title, respectively. - Title objects passed to
install_title()will now install properly if they were created from individual components rather than directly from a WAD.
New Module: cert
- Contains a new Certificate class used to store the various certificates used by the Wii for content validation.
- Contains a new CertificateChain class used to store the entire chain of certificates needed a validate an entire Wii title.
- Adds the function
validate_ca_cert()for validating a retail or development CA certificate. - Adds the function
validate_cert_sig()for validating any TMD or Ticket certificate using a CA certificate. - Adds the functions
validate_tmd_sig()andvalidate_ticket_sig()for validating a TMD or Ticket using the appropriate certificates.
New Module: lz77
- Adds the function
decompress_lz77()to decompress any file that was compressed using the Wii's flavor of the LZ77 compression algorithm. - Adds the function
compress_lz77()to compress any file using the Wii's flavor of the LZ77 compression algorithm. Supports two levels of compression, labeled as just 1 or 2, with 1 being the default. This function is currently very slow when run on files greater than a couple hundred kilobytes.
New Class: IMETHeader
- New class for handling the IMET header that precedes the data of a banner in a Wii channel. This header stores the name of the channel for every applicable region, as well as the sizes of the banner's files.
- This class is mostly just for parsing right now, but in the future when more banner support is added, you'll be able to use it for other banner-creation functionality.
- Provides the methods
get_channel_names()andset_channel_names()to get or set the channel name for the specified region(s).
New Class: IMD5Header
- New class for storing the information stored in an IMD5 header. This is currently only a data class, as the banner parsing functionality required to extend it doesn't exist yet.
The API documentation has been totally redone since the previous release. You can see our fancy new documentation right here.
This release is also on PyPI.
v0.5.2: Hotfix and Dev WAD Support
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 kwargdev, 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()anddecrypt_title_key()now accept the kwarddev, which when set to True will cause them to pass that True along toget_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()propertyis_devwill be set to True if the signature issuer is the one used for development titles. - The
Ticket()methodget_title_key()and theTitle()methodset_title_id()now pass the newTicketpropertyis_devalong todecrypt_title_key()andset_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.
This release is also available on PyPI.
v0.5.1: Minor Fixes and Improvements
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
emunandandsyshave been moved under a newnandsubpackage. You will now need to reference them using thelibWiiPy.nandprefix instead oflibWiiPy.title. An overview of this new subpackage can be found in the API documentation.
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, andKOR. - The
Title()class now offersget_title_size()andget_title_size_blocks()to get the size of the entire title in either bytes or blocks, respectively. Both methods accept the kwargabsoluteto 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 returnSystemregardless of the actual type. - Adding new content to an existing title now works as expected. Previously, the
num_contentsproperty of the TMD was not updated, so content added beyond the original count would not be saved when dumping a WAD. ContentRegion()now offersremove_content_by_index()andremove_content_by_cid()to remove a specified content from a title.Title()now offersadd_content()andadd_enc_content()so that you do not have to interface with the underlyingContentRegion()directly to add new content to a title.ContentRegion()now offers the methodget_index_from_cid()to resolve a content index from a Content ID.
New Class: SettingTxt
- New class for handling the
setting.txtfile used by the System Menu to store your console's region and serial number. - Allows for parsing
setting.txtby 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.
This release is also available on PyPI.
v0.5.0: Too Many Updates to Summarize
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.mapfile 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(), andpatch_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.sysfile 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()andget_title_size_blocks()to get the installed size of the title in bytes and blocks, respectively.
TMD
- A TMD's
access_rightsproperty is now properly stored as an integer. - TMDs now offer the
AccessFlagsenum that defines the bits used to determine and set access rights. Current values areDVD_VIDEOandAHB. - 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 alongsideAccessFlags. - 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 useget_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.
This release is also available on PyPI.
v0.4.1: Minor Fixes and Fakesigning Support
Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience.
Changelog:
- The
tmdandticketmodules now offer afakesign()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
titlemodule now offersfakesign()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
tmdmodule 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
tmdmodule, 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
u8module, 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.
v0.4.0: ASH Decompression Support
Changelog:
- Added new
ashmodule 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 thelibWiiPy.archivesubpackage - 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/.
This release is also available on PyPI.
v0.3.1: Hotfix Release
Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience.
Changelog:
pack_u8()now raises aFileNotFounderror 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.
v0.3.0: U8 extraction/packing support!
Changelog:
- Added new
u8module to handle U8 archive files (files with extensions .app, .arc, .carc, and .szs) - New classes
U8ArchiveandU8Nodeto assist in U8 handling, however these are unlikely to be used directly under normal use - New function
pack_u8()to pack a file or folder into a U8 archive - New function
extract_u8()to extract a U8 archive into a folder - Completely redid package structure! This is breaking!
- All title-related modules have been moved into the subpackage
titleand can now be accessed with the prefixlibWiiPy.titleinstead of onlylibWiiPy - New archive-related modules like the new
u8one are located under the prefixlibWiiPy.archive - Added the basics for writing tests for the library in the future
This release is also available on PyPI.
v0.2.3: Minor Enhancements
Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience.
Changelog:
- Added the ability to use the Wii U NUS endpoint (
http://ccs.cdn.wup.shop.nintendo.net/ccs/download/) to the NUS module, allowing you to get a decent speed increase with downloads by addingwiiu_endpoint=Trueto any NUS function. - Added
encrypt_title_key()to the Crypto module, allowing you to re-encrypt any decrypted Title Key with any common key you choose. - Improved IV handling when decrypting Title Keys in the Crypto module, so that you can now pass the Title ID used as the IV in any of three formats (
b'0102',b'\x01\x02',"0102"). - Replaced unnecessary uses of BytesIO objects when dumping WAD, TMD, Ticket, and Content objects back into raw data.
- Updated comments in the TMD module that describe various properties stored in a TMD thanks to new information from @rvtr.
- The TMD module now reads and writes two "reserved" regions of a TMD that were previously ignored and written out as all zeroes, because they were found to be critical on the DSi in libTWLPy, and may be important here.
This release is also available on PyPI.
v0.2.2: NUS Downloading Improvements!
Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience.
Changelog:
- Changed the NUS endpoint URL from
http://ccs.shop.wii.com/ccs/downloadtohttps://nus.cdn.shop.wii.com/ccs/download, which massively improves NUS download speeds. Really should've figured this one out sooner... - boot2 WADs are now dumped properly as type
ibinstead of typeIs. - The TMD instance method
get_title_type()now returnsGameChannelinstead ofGameWithChannelfor a TID high of00010004, since this ID refers to channels installed by games and not the games themselves.
This release is also available on PyPI.