mcm2bin.py 367 B

1234567891011121314151617
  1. #!/usr/bin/env python
  2. import sys
  3. if len(sys.argv) < 3:
  4. print("Usage: ./mcm2bin.py clarity.mcm clarity.bin")
  5. exit()
  6. with open(sys.argv[1]) as inp:
  7. content = inp.readlines()
  8. content.pop(0)
  9. with open(sys.argv[2], 'wb') as out:
  10. for i, line in enumerate(content):
  11. if i % 64 < 54:
  12. b = int(line, 2)
  13. out.write(bytearray([b]))