mirror of
https://github.com/NinjaCheetah/WiiPy.git
synced 2025-04-26 13:21:01 -04:00
Removed fakesigning code, as it is now part of libWiiPy instead
This commit is contained in:
parent
9abdf4af04
commit
4ba95d0472
@ -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)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user