import struct
import sys
import ctypes

with open(sys.argv[1], "rb") as infile:
    data = bytearray(infile.read())
    data[0x1c:0x20] = struct.pack("<I", 0)

    checksum = 0
    for i in range(0, len(data), 4):
        checksum += struct.unpack(">I", data[i:i+4])[0]
        checksum &= 0xffffffff

checksum_diff = 0xffffffff - checksum

print("%08x %08x" % (checksum, checksum_diff))

if checksum_diff != 0:
    with open(sys.argv[1], "rb+") as outfile:
        outfile.seek(0x1c)
        outfile.write(struct.pack(">I", checksum_diff))

3b3f2dc47945cd94d34f7c43b6fb2a938bcbcaa5
<mask token>

<mask token>
with open(sys.argv[1], 'rb') as infile:
    data = bytearray(infile.read())
    data[28:32] = struct.pack('<I', 0)
    checksum = 0
    for i in range(0, len(data), 4):
        checksum += struct.unpack('>I', data[i:i + 4])[0]
        checksum &= 4294967295
<mask token>
print('%08x %08x' % (checksum, checksum_diff))
if checksum_diff != 0:
    with open(sys.argv[1], 'rb+') as outfile:
        outfile.seek(28)
        outfile.write(struct.pack('>I', checksum_diff))

<mask token>
with open(sys.argv[1], 'rb') as infile:
    data = bytearray(infile.read())
    data[28:32] = struct.pack('<I', 0)
    checksum = 0
    for i in range(0, len(data), 4):
        checksum += struct.unpack('>I', data[i:i + 4])[0]
        checksum &= 4294967295
checksum_diff = 4294967295 - checksum
print('%08x %08x' % (checksum, checksum_diff))
if checksum_diff != 0:
    with open(sys.argv[1], 'rb+') as outfile:
        outfile.seek(28)
        outfile.write(struct.pack('>I', checksum_diff))

import struct
import sys
import ctypes
with open(sys.argv[1], 'rb') as infile:
    data = bytearray(infile.read())
    data[28:32] = struct.pack('<I', 0)
    checksum = 0
    for i in range(0, len(data), 4):
        checksum += struct.unpack('>I', data[i:i + 4])[0]
        checksum &= 4294967295
checksum_diff = 4294967295 - checksum
print('%08x %08x' % (checksum, checksum_diff))
if checksum_diff != 0:
    with open(sys.argv[1], 'rb+') as outfile:
        outfile.seek(28)
        outfile.write(struct.pack('>I', checksum_diff))

import struct
import sys
import ctypes

with open(sys.argv[1], "rb") as infile:
    data = bytearray(infile.read())
    data[0x1c:0x20] = struct.pack("<I", 0)

    checksum = 0
    for i in range(0, len(data), 4):
        checksum += struct.unpack(">I", data[i:i+4])[0]
        checksum &= 0xffffffff

checksum_diff = 0xffffffff - checksum

print("%08x %08x" % (checksum, checksum_diff))

if checksum_diff != 0:
    with open(sys.argv[1], "rb+") as outfile:
        outfile.seek(0x1c)
        outfile.write(struct.pack(">I", checksum_diff))
