diff --git a/pyproject.toml b/pyproject.toml index 623e785..27b6772 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "libWiiPy" -version = "0.4.1" +version = "0.4.2" authors = [ { name="NinjaCheetah", email="ninjacheetah@ncxprogramming.com" }, { name="Lillian Skinner", email="lillian@randommeaninglesscharacters.com" } diff --git a/src/libWiiPy/title/content.py b/src/libWiiPy/title/content.py index 4a5c9db..e7ae048 100644 --- a/src/libWiiPy/title/content.py +++ b/src/libWiiPy/title/content.py @@ -355,7 +355,10 @@ class ContentRegion: "Expected hash is: {}\n".format(self.content_records[index].content_hash.decode()) + "Actual hash is: {}".format(content_hash)) # If the hash matches, encrypt the content and set it where it belongs. - enc_content = encrypt_content(dec_content, title_key, index) + # This uses the index from the content records instead of just the index given, because there are some strange + # circumstances where the actual index in the array and the assigned content index don't match up, and this + # needs to accommodate that. + enc_content = encrypt_content(dec_content, title_key, self.content_records[index].index) if (index + 1) > len(self.content_list): self.content_list.append(enc_content) else: