diff --git a/checksum.py b/checksum.py index 7ba5d19..7f3d6a7 100644 --- a/checksum.py +++ b/checksum.py @@ -5,7 +5,9 @@ with open(sys.argv[1], mode='rb') as file: file.read(4) # discard first four bytes rombin = file.read() # read rest of file cksum = 0 + count = 0; for i in struct.unpack('>' + str(len(rombin)/2) + 'H', rombin): - cksum += i; + cksum += i + count += 1 cksum &= 0xFFFFFFFF print(hex(cksum))