mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2025-04-27 05:41:01 -04:00
Improve formatting of 4 character ASCII TID
This commit is contained in:
parent
f9739eab58
commit
d6aa50697f
@ -11,9 +11,14 @@ from modules.core import fatal_error
|
|||||||
def _print_tmd_info(tmd: libWiiPy.title.TMD):
|
def _print_tmd_info(tmd: libWiiPy.title.TMD):
|
||||||
# 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("Title Info")
|
print("Title Info")
|
||||||
|
ascii_tid = ""
|
||||||
try:
|
try:
|
||||||
print(f" Title ID: {tmd.title_id.upper()} ({str(bytes.fromhex(tmd.title_id[8:]).decode()).upper()})")
|
ascii_tid = (bytes.fromhex(tmd.title_id[8:].replace("00", "30"))).decode("ascii")
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
|
pass
|
||||||
|
if ascii_tid.isalnum():
|
||||||
|
print(f" Title ID: {tmd.title_id.upper()} ({ascii_tid})")
|
||||||
|
else:
|
||||||
print(f" Title ID: {tmd.title_id.upper()}")
|
print(f" Title ID: {tmd.title_id.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 tmd.title_id.startswith("00000001"):
|
if tmd.title_id.startswith("00000001"):
|
||||||
@ -80,10 +85,14 @@ def _print_tmd_info(tmd: libWiiPy.title.TMD):
|
|||||||
def _print_ticket_info(ticket: libWiiPy.title.Ticket):
|
def _print_ticket_info(ticket: libWiiPy.title.Ticket):
|
||||||
# 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 = ""
|
||||||
try:
|
try:
|
||||||
print(f" Title ID: {ticket.title_id.decode().upper()} "
|
ascii_tid = str(bytes.fromhex(ticket.title_id.decode()[8:].replace("00", "30")).decode("ascii")).upper()
|
||||||
f"({str(bytes.fromhex(ticket.title_id.decode()[8:]).decode()).upper()})")
|
except UnicodeDecodeError or binascii.Error:
|
||||||
except UnicodeDecodeError:
|
pass
|
||||||
|
if ascii_tid.isalnum():
|
||||||
|
print(f" Title ID: {ticket.title_id.decode().upper()} ({ascii_tid})")
|
||||||
|
else:
|
||||||
print(f" Title ID: {ticket.title_id.decode().upper()}")
|
print(f" Title ID: {ticket.title_id.decode().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 ticket.title_id.decode().startswith("00000001"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user