Compare commits

..

No commits in common. "main" and "v0.6.0" have entirely different histories.
main ... v0.6.0

5 changed files with 3 additions and 17 deletions

View File

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

View File

@ -128,10 +128,6 @@ class EmuNAND:
uid_sys = _UidSys() uid_sys = _UidSys()
if not uid_sys_path.exists(): if not uid_sys_path.exists():
uid_sys.create() uid_sys.create()
else:
uid_sys.load(uid_sys_path.read_bytes())
uid_sys.add(title.tmd.title_id)
uid_sys_path.write_bytes(uid_sys.dump())
def uninstall_title(self, tid: str) -> None: def uninstall_title(self, tid: str) -> None:
""" """

View File

@ -77,8 +77,7 @@ class UidSys:
def add(self, title_id: str | bytes) -> int: def add(self, title_id: str | bytes) -> int:
""" """
Adds a new Title ID to the uid.sys file and returns the UID assigned to that title. The new entry will only Adds a new Title ID to the uid.sys file and returns the UID assigned to that title.
be added if the provided Title ID doesn't already have an assigned UID.
Parameters Parameters
---------- ----------
@ -107,11 +106,6 @@ class UidSys:
title_id_converted = title_id title_id_converted = title_id
else: else:
raise TypeError("Title ID type is not valid! It must be either type str or bytes.") raise TypeError("Title ID type is not valid! It must be either type str or bytes.")
# Ensure this TID hasn't already been assigned a UID. If it has, just exit early and return the UID.
if self.uid_entries.count != 0:
for entry in self.uid_entries:
if entry.title_id == title_id_converted:
return entry.uid
# Generate the new UID by incrementing the current highest UID by 1. # Generate the new UID by incrementing the current highest UID by 1.
try: try:
new_uid = self.uid_entries[-1].uid + 1 new_uid = self.uid_entries[-1].uid + 1

View File

@ -75,7 +75,7 @@ class Ticket:
self.title_version: int = 0 # Version of the ticket's associated title. self.title_version: int = 0 # Version of the ticket's associated title.
self.permitted_titles: bytes = b'' # Permitted titles mask self.permitted_titles: bytes = b'' # Permitted titles mask
# "Permit mask. The current disc title is ANDed with the inverse of this mask to see if the result matches the # "Permit mask. The current disc title is ANDed with the inverse of this mask to see if the result matches the
# Permitted Titles Mask." -WiiBrew # Permitted Titles Mask."
self.permit_mask: bytes = b'' self.permit_mask: bytes = b''
self.title_export_allowed: int = 0 # Whether title export is allowed with a PRNG key or not. self.title_export_allowed: int = 0 # Whether title export is allowed with a PRNG key or not.
self.common_key_index: int = 0 # Which common key should be used. 0 = Common Key, 1 = Korean Key, 2 = vWii Key self.common_key_index: int = 0 # Which common key should be used. 0 = Common Key, 1 = Korean Key, 2 = vWii Key

View File

@ -194,8 +194,6 @@ class Title:
bytes bytes
The decrypted content listed in the content record. The decrypted content listed in the content record.
""" """
if self.ticket.title_id == "":
raise ValueError("A Ticket must be loaded to get decrypted content.")
dec_content = self.content.get_content_by_index(index, self.ticket.get_title_key(), skip_hash) dec_content = self.content.get_content_by_index(index, self.ticket.get_title_key(), skip_hash)
return dec_content return dec_content
@ -215,8 +213,6 @@ class Title:
bytes bytes
The decrypted content listed in the content record. The decrypted content listed in the content record.
""" """
if self.ticket.title_id == "":
raise ValueError("A Ticket must be loaded to get decrypted content.")
dec_content = self.content.get_content_by_cid(cid, self.ticket.get_title_key(), skip_hash) dec_content = self.content.get_content_by_cid(cid, self.ticket.get_title_key(), skip_hash)
return dec_content return dec_content