mirror of
https://github.com/NinjaCheetah/libWiiPy.git
synced 2025-04-25 12:51:01 -04:00
(Title) Add check to make sure Ticket data exist before decrypting content
This commit is contained in:
parent
8adbef26b1
commit
8269a0db98
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "libWiiPy"
|
name = "libWiiPy"
|
||||||
version = "0.6.0"
|
version = "0.6.1"
|
||||||
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" }
|
||||||
|
@ -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."
|
# Permitted Titles Mask." -WiiBrew
|
||||||
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
|
||||||
|
@ -194,6 +194,8 @@ 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
|
||||||
|
|
||||||
@ -213,6 +215,8 @@ 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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user