USB: move firmware for usb-to-serial MCU (CH552)

Change links to the new ch552_fw directory.
This commit is contained in:
dehanj 2024-06-19 13:26:46 +02:00 committed by Michael Cardell Widerkrantz
parent c271b48a53
commit 354aecbed6
No known key found for this signature in database
GPG key ID: D3DB3DDF57E704E5
17 changed files with 3 additions and 3 deletions

View file

@ -0,0 +1,28 @@
#!/usr/bin/env python3
import uuid
import argparse
import encode_usb_strings
magic = encode_usb_strings.string_to_descriptor("68de5d27-e223-4874-bc76-a54d6e84068f")
replacement = encode_usb_strings.string_to_descriptor(str(uuid.uuid4()))
parser = argparse.ArgumentParser(description='CH552 USB serial number injector. Replaces the default UUID with a randomly generated UUID4')
parser.add_argument('-i', required=True, help='input file')
parser.add_argument('-o', required=True, help='output file')
args = parser.parse_args()
f = bytearray(open(args.i, 'rb').read())
pos = f.find(magic)
if pos < 0:
print('failed to find magic string')
exit(1)
f[pos:(pos+len(magic))] = replacement
with open(args.o, 'wb') as of:
of.write(f)