1
0
mirror of synced 2026-03-01 17:47:51 +00:00
Files
MicroCoreLabs.Projects/XTMax/Drivers/BootROM/checksum.py
2025-02-16 15:11:10 -08:00

7 lines
186 B
Python

with open("bootrom", "rb") as f:
b = bytearray(f.read())
# compute the checksum and store a byte to
b[-1] = 256 - sum(b[0:-1]) & 0xff
with open("bootrom", "wb") as f:
f.write(b)