#!/usr/bin/env python import struct SIGNATURE_AREA_SIZE = 512 - 8 def main(): fw = open("fw.bin", "rb").read() if fw[:4] == b'SHWF': print("Firmware already prepared") exit(1) header = b'SHWF' header += struct.pack('