From 4ba95d04724ae52755e1240eca5b76ea9ef295a7 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Wed, 17 Jul 2024 20:51:17 -0400 Subject: [PATCH] Removed fakesigning code, as it is now part of libWiiPy instead --- modules/wad.py | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/modules/wad.py b/modules/wad.py index 5276342..ba137db 100644 --- a/modules/wad.py +++ b/modules/wad.py @@ -71,31 +71,9 @@ def handle_wad(args): # Method to ensure that the title's content records match between the TMD() and ContentRegion() objects. title.load_content_records() - # Fakesign the TMD and Ticket using the trucha bug, if enabled. - # 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. + # Fakesign the TMD and Ticket using the trucha bug, if enabled. This is built-in in libWiiPy v0.4.1+. if args.fakesign: - tmd = title.tmd - 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 + title.fakesign() # 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)):