From b5af8029441622f5c3f6babefd8a6f6bdc3b4496 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Sun, 2 Jun 2019 09:55:43 +0800 Subject: [PATCH] Hacky Pippin ROM support The Pippin ROM has lower checksums than expected, by about 4%. Without recovering the missing data, this probably cannot be replicated, so we just detect it and live with it. --- tbxi/powerpc_dump.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tbxi/powerpc_dump.py b/tbxi/powerpc_dump.py index a4932e9..e0b422c 100644 --- a/tbxi/powerpc_dump.py +++ b/tbxi/powerpc_dump.py @@ -119,10 +119,19 @@ def find_configinfo(binary): allsums = b''.join(x.to_bytes(4, byteorder='big') for x in sum32) allsums += sum64.to_bytes(8, byteorder='big') + # if i == 0x30d000: # for figuring out pippin in future + # print(*['%02X' % x for x in allsums]) + # print(*['%02X' % x for x in binary[i:i+len(allsums)]]) + if binary[i:i+len(allsums)] == allsums: break else: - return + # Hack for Pippin ROM, which has bad checksum + for i in range(0x300000, len(binary), 0x100): + if binary[i+0x64:].startswith(b'Boot '): + break + else: + return # failed! # Which structs share the BootstrapVersion signature? for j in range(0, len(binary), 0x100):