Removed fakesigning code, as it is now part of libWiiPy instead

This commit is contained in:
Campbell 2024-07-17 20:51:17 -04:00
parent 9abdf4af04
commit 4ba95d0472
Signed by: NinjaCheetah
GPG Key ID: B547958AF96ED344

View File

@ -71,31 +71,9 @@ def handle_wad(args):
# Method to ensure that the title's content records match between the TMD() and ContentRegion() objects. # Method to ensure that the title's content records match between the TMD() and ContentRegion() objects.
title.load_content_records() title.load_content_records()
# Fakesign the TMD and Ticket using the trucha bug, if enabled. # Fakesign the TMD and Ticket using the trucha bug, if enabled. This is built-in in libWiiPy v0.4.1+.
# This is done by changing an unused portion of both the TMD and Ticket, and then calculating the SHA-1 hash
# of the TMD/Ticket without the signature, and seeing if it begins with a null byte.
if args.fakesign: if args.fakesign:
tmd = title.tmd title.fakesign()
tmd.signature = b'\x00' * 256
current_int = 0
test_hash = 'gggggggggggggggggggggggggggggggggggggggg'
while test_hash[:2] != '00':
current_int += 1
tmd.minor_version = current_int
test_hash = hashlib.sha1(tmd.dump()[320:]).hexdigest()
title.tmd = tmd
ticket = title.ticket
title.ticket.signature = b'\x00' * 256
current_int = 0
test_hash = 'gggggggggggggggggggggggggggggggggggggggg'
while test_hash[:2] != '00':
current_int += 1
data_to_edit = ticket.unknown2
data_to_edit = int.to_bytes(current_int, 2) + data_to_edit[2:]
ticket.unknown2 = data_to_edit
test_hash = hashlib.sha1(ticket.dump()[320:]).hexdigest()
title.ticket = ticket
# Iterate over every file in the content_files list, and attempt to load it into the Title(). # Iterate over every file in the content_files list, and attempt to load it into the Title().
for index in range(len(title.content.content_records)): for index in range(len(title.content.content_records)):