diff --git a/src/libWiiPy/crypto.py b/src/libWiiPy/crypto.py index 1a6b57a..7e2c8b1 100644 --- a/src/libWiiPy/crypto.py +++ b/src/libWiiPy/crypto.py @@ -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 diff --git a/src/libWiiPy/title.py b/src/libWiiPy/title.py index 081bbc7..4478a62 100644 --- a/src/libWiiPy/title.py +++ b/src/libWiiPy/title.py @@ -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. diff --git a/src/libWiiPy/tmd.py b/src/libWiiPy/tmd.py index 54cbb07..4f78e46 100644 --- a/src/libWiiPy/tmd.py +++ b/src/libWiiPy/tmd.py @@ -257,7 +257,7 @@ class TMD: Gets the type of the TMD's associated title. Can be one of several possible values: - 'System', 'Game', 'Channel', 'SystemChannel', 'GameWithChannel', or 'HiddenChannel' + 'System', 'Game', 'Channel', 'SystemChannel', 'GameChannel', or 'HiddenChannel' Returns ------- @@ -275,7 +275,7 @@ class TMD: case '00010002': return "SystemChannel" case '00010004': - return "GameWithChannel" + return "GameChannel" case '00010005': return "DLC" case '00010008':