Correctly pack boot2 WADs as type "ib" and not "Is"

This commit is contained in:
Campbell 2024-04-14 12:58:40 -04:00
parent 338446efcb
commit a85beac602
Signed by: NinjaCheetah
GPG Key ID: B547958AF96ED344
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "libWiiPy"
version = "0.2.1"
version = "0.2.2"
authors = [
{ name="NinjaCheetah", email="ninjacheetah@ncxprogramming.com" },
{ name="Lillian Skinner", email="lillian@randommeaninglesscharacters.com" }

View File

@ -72,8 +72,7 @@ def decrypt_content(content_enc, title_key, content_index, content_length) -> by
# Decrypt the content using the AES object.
content_dec = aes.decrypt(content_enc)
# Trim additional bytes that may have been added so the content is the correct size.
while len(content_dec) > content_length:
content_dec = content_dec[:-1]
content_dec = content_dec[:content_length]
return content_dec

View File

@ -70,6 +70,9 @@ class Title:
wad_data : bytes
The raw data of the WAD.
"""
# Set WAD type to ib if the title being packed is boot2.
if self.tmd.title_id == "0000000100000001":
self.wad.wad_type = "ib"
# Dump the TMD and set it in the WAD.
self.wad.set_tmd_data(self.tmd.dump())
# Dump the Ticket and set it in the WAD.