Files
2026-10-29 10:55:49 +03:00

18 lines
480 B
Python

import sys
from pathlib import Path
OFFSET = 0x75AC
BEFORE = bytes.fromhex("84 c0 0f 84 5c 03 00 00 41 80 7e 0c 00 0f 84 ba 03 00 00")
AFTER = bytes.fromhex("41 80 7e 0c 00 0f 84 c2 03 00 00 84 c0 0f 84 51 03 00 00")
path = Path(sys.argv[1])
with path.open("r+b") as binary:
binary.seek(OFFSET)
current = binary.read(len(BEFORE))
if current != BEFORE:
raise SystemExit("unexpected greenhouse-console build")
binary.seek(OFFSET)
binary.write(AFTER)