mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2025-04-26 13:21:01 -04:00
Updated signing info in info command to match rustii's formatting
This commit is contained in:
parent
b123005bf5
commit
8e7489ec57
@ -74,19 +74,18 @@ def _print_tmd_info(tmd: libWiiPy.title.TMD, signing_cert=None):
|
|||||||
print(f" AHB Access: {tmd.get_access_right(tmd.AccessFlags.AHB)}")
|
print(f" AHB Access: {tmd.get_access_right(tmd.AccessFlags.AHB)}")
|
||||||
if signing_cert is not None:
|
if signing_cert is not None:
|
||||||
try:
|
try:
|
||||||
signed = libWiiPy.title.verify_tmd_sig(signing_cert, tmd)
|
if libWiiPy.title.verify_tmd_sig(signing_cert, tmd):
|
||||||
if signed:
|
signing_str = "Valid (Unmodified TMD)"
|
||||||
signing_str = "Valid (Unmodified)"
|
|
||||||
elif tmd.get_is_fakesigned():
|
elif tmd.get_is_fakesigned():
|
||||||
signing_str = "Fakesigned"
|
signing_str = "Fakesigned"
|
||||||
else:
|
else:
|
||||||
signing_str = "Invalid (Modified)"
|
signing_str = "Invalid (Modified TMD)"
|
||||||
except ValueError:
|
except ValueError:
|
||||||
if tmd.get_is_fakesigned():
|
if tmd.get_is_fakesigned():
|
||||||
signing_str = "Fakesigned"
|
signing_str = "Fakesigned"
|
||||||
else:
|
else:
|
||||||
signing_str = "Invalid (Modified)"
|
signing_str = "Invalid (Modified TMD)"
|
||||||
print(f" Signing Status: {signing_str}")
|
print(f" Signature: {signing_str}")
|
||||||
else:
|
else:
|
||||||
print(f" Fakesigned: {tmd.get_is_fakesigned()}")
|
print(f" Fakesigned: {tmd.get_is_fakesigned()}")
|
||||||
# Iterate over the content and print their details.
|
# Iterate over the content and print their details.
|
||||||
@ -153,19 +152,18 @@ def _print_ticket_info(ticket: libWiiPy.title.Ticket, signing_cert=None):
|
|||||||
print(f" Title Key (Decrypted): {binascii.hexlify(ticket.get_title_key()).decode()}")
|
print(f" Title Key (Decrypted): {binascii.hexlify(ticket.get_title_key()).decode()}")
|
||||||
if signing_cert is not None:
|
if signing_cert is not None:
|
||||||
try:
|
try:
|
||||||
signed = libWiiPy.title.verify_ticket_sig(signing_cert, ticket)
|
if libWiiPy.title.verify_ticket_sig(signing_cert, ticket):
|
||||||
if signed:
|
signing_str = "Valid (Unmodified Ticket)"
|
||||||
signing_str = "Valid (Unmodified)"
|
|
||||||
elif ticket.get_is_fakesigned():
|
elif ticket.get_is_fakesigned():
|
||||||
signing_str = "Fakesigned"
|
signing_str = "Fakesigned"
|
||||||
else:
|
else:
|
||||||
signing_str = "Invalid (Modified)"
|
signing_str = "Invalid (Modified Ticket)"
|
||||||
except ValueError:
|
except ValueError:
|
||||||
if ticket.get_is_fakesigned():
|
if ticket.get_is_fakesigned():
|
||||||
signing_str = "Fakesigned"
|
signing_str = "Fakesigned"
|
||||||
else:
|
else:
|
||||||
signing_str = "Invalid (Modified)"
|
signing_str = "Invalid (Modified Ticket)"
|
||||||
print(f" Signing Status: {signing_str}")
|
print(f" Signature: {signing_str}")
|
||||||
else:
|
else:
|
||||||
print(f" Fakesigned: {ticket.get_is_fakesigned()}")
|
print(f" Fakesigned: {ticket.get_is_fakesigned()}")
|
||||||
|
|
||||||
@ -205,17 +203,22 @@ def _print_wad_info(title: libWiiPy.title.Title):
|
|||||||
tmd_cert = None
|
tmd_cert = None
|
||||||
ticket_cert = None
|
ticket_cert = None
|
||||||
try:
|
try:
|
||||||
signed = title.get_is_signed()
|
|
||||||
tmd_cert = title.cert_chain.tmd_cert
|
tmd_cert = title.cert_chain.tmd_cert
|
||||||
ticket_cert = title.cert_chain.ticket_cert
|
ticket_cert = title.cert_chain.ticket_cert
|
||||||
if signed:
|
if title.get_is_signed():
|
||||||
signing_str = "Valid (Unmodified)"
|
signing_str = "Legitimate (Unmodified TMD + Ticket)"
|
||||||
elif title.get_is_fakesigned():
|
elif title.get_is_fakesigned():
|
||||||
signing_str = "Fakesigned"
|
signing_str = "Fakesigned"
|
||||||
|
elif (libWiiPy.title.verify_tmd_sig(tmd_cert, title.tmd)
|
||||||
|
and not libWiiPy.title.verify_ticket_sig(ticket_cert, title.ticket)):
|
||||||
|
signing_str = "Piratelegit (Unmodified TMD, Modified Ticket)"
|
||||||
|
elif (not libWiiPy.title.verify_tmd_sig(tmd_cert, title.tmd)
|
||||||
|
and libWiiPy.title.verify_ticket_sig(ticket_cert, title.ticket)):
|
||||||
|
signing_str = "Edited (Modified TMD, Unmodified Ticket)"
|
||||||
else:
|
else:
|
||||||
signing_str = "Invalid (Modified)"
|
signing_str = "Illegitimate (Modified TMD + Ticket)"
|
||||||
except ValueError:
|
except ValueError:
|
||||||
signing_str = "Invalid (Modified)"
|
signing_str = "Illegitimate (Modified TMD + Ticket)"
|
||||||
print(f" Signing Status: {signing_str}")
|
print(f" Signing Status: {signing_str}")
|
||||||
print("")
|
print("")
|
||||||
_print_ticket_info(title.ticket, ticket_cert)
|
_print_ticket_info(title.ticket, ticket_cert)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user