ceda-code-experiments/makepacket.py

15 lines
237 B
Python
Raw Permalink Normal View History

2023-03-04 22:09:40 +00:00
#!/usr/bin/python3
import sys
import struct
filename = sys.argv[1]
ofile = open(filename + ".pkt", 'wb')
ifile = open(filename, 'rb')
content = ifile.read()
ofile.write(struct.pack("<HH", 0x1000, len(content)))
ofile.write(content)