Fix FPT checksum calculation for ME11
This commit is contained in:
parent
ba885fa9fc
commit
518445323b
1 changed files with 3 additions and 1 deletions
|
@ -421,10 +421,12 @@ if __name__ == "__main__":
|
|||
if me11:
|
||||
mef.seek(me_start + 0x10)
|
||||
header = bytearray(mef.read(0x20))
|
||||
header[0x0b] = 0x00
|
||||
else:
|
||||
mef.seek(me_start)
|
||||
header = bytearray(mef.read(0x30))
|
||||
checksum = (0x100 - (sum(header) - header[0x1b]) & 0xff) & 0xff
|
||||
header[0x1b] = 0x00
|
||||
checksum = (0x100 - sum(header) & 0xff) & 0xff
|
||||
|
||||
print("Correcting checksum (0x{:02x})...".format(checksum))
|
||||
# The checksum is just the two's complement of the sum of the first
|
||||
|
|
Loading…
Reference in a new issue