mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2026-01-07 11:25:59 -05:00
Fix bug with printing Ticket info
This commit is contained in:
parent
935f5eb7df
commit
4b7eae8e85
@ -106,22 +106,23 @@ def _print_ticket_info(ticket: libWiiPy.title.Ticket, signing_cert=None):
|
|||||||
# Get all important keys from the TMD and print them out nicely.
|
# Get all important keys from the TMD and print them out nicely.
|
||||||
print(f"Ticket Info")
|
print(f"Ticket Info")
|
||||||
ascii_tid = ""
|
ascii_tid = ""
|
||||||
|
decoded_tid = binascii.hexlify(ticket.title_id).decode()
|
||||||
try:
|
try:
|
||||||
ascii_tid = str(bytes.fromhex(binascii.hexlify(ticket.title_id).decode()[8:].replace("00", "30")).decode("ascii"))
|
ascii_tid = str(bytes.fromhex(decoded_tid[8:].replace("00", "30")).decode("ascii"))
|
||||||
except UnicodeDecodeError or binascii.Error:
|
except UnicodeDecodeError:
|
||||||
pass
|
pass
|
||||||
pattern = r"^[a-z0-9!@#$%^&*]{4}$"
|
pattern = r"^[a-z0-9!@#$%^&*]{4}$"
|
||||||
if re.fullmatch(pattern, ascii_tid, re.IGNORECASE):
|
if re.fullmatch(pattern, ascii_tid, re.IGNORECASE):
|
||||||
print(f" Title ID: {binascii.hexlify(ticket.title_id).decode().upper()} ({ascii_tid})")
|
print(f" Title ID: {decoded_tid.upper()} ({ascii_tid})")
|
||||||
else:
|
else:
|
||||||
print(f" Title ID: {binascii.hexlify(ticket.title_id).decode().upper()}")
|
print(f" Title ID: {decoded_tid.upper()}")
|
||||||
# This type of version number really only applies to the System Menu and IOS.
|
# This type of version number really only applies to the System Menu and IOS.
|
||||||
if ticket.title_id.decode().startswith("00000001"):
|
if decoded_tid.startswith("00000001"):
|
||||||
if ticket.title_id.decode() == "0000000100000001":
|
if decoded_tid == "0000000100000001":
|
||||||
print(f" Title Version: {ticket.title_version} (boot2v{ticket.title_version})")
|
print(f" Title Version: {ticket.title_version} (boot2v{ticket.title_version})")
|
||||||
else:
|
else:
|
||||||
print(f" Title Version: {ticket.title_version} "
|
print(f" Title Version: {ticket.title_version} "
|
||||||
f"({libWiiPy.title.title_ver_dec_to_standard(ticket.title_version, ticket.title_id.decode())})")
|
f"({libWiiPy.title.title_ver_dec_to_standard(ticket.title_version, decoded_tid)})")
|
||||||
else:
|
else:
|
||||||
print(f" Title Version: {ticket.title_version}")
|
print(f" Title Version: {ticket.title_version}")
|
||||||
print(f" Ticket Version: {ticket.ticket_version}")
|
print(f" Ticket Version: {ticket.ticket_version}")
|
||||||
|
|||||||
2
wiipy.py
2
wiipy.py
@ -18,7 +18,7 @@ from commands.title.nus import *
|
|||||||
from commands.title.tmd import *
|
from commands.title.tmd import *
|
||||||
from commands.title.wad import *
|
from commands.title.wad import *
|
||||||
|
|
||||||
wiipy_ver = "1.5.1"
|
wiipy_ver = "1.6.0"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Main argument parser.
|
# Main argument parser.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user