logo

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

Unnamed repository; edit this file 'description' to name the repository. git clone https://hacktivis.me/git/mirror/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.git

E2.py (634B)


  1. #!/usr/bin/env python3.7
  2. import sys
  3. import struct
  4. from array import *
  5. if len(sys.argv) is not 3:
  6. print('usage : E2.py [input file] [output file]')
  7. exit(-1)
  8. inFile = open(sys.argv[1], mode='rb')
  9. outFile = open(sys.argv[2], mode='wb')
  10. for buffer in iter(lambda: inFile.read(8), b''):
  11. bin_array = array('B')
  12. bin_str = ''
  13. for c in buffer:
  14. if c == ord('E'):
  15. bin_str += '1'
  16. elif c == ord('e'):
  17. bin_str += '0'
  18. else:
  19. print('error!')
  20. exit(-1)
  21. bin_array.append(int(bin_str, base=2))
  22. bin_array.tofile(outFile)
  23. inFile.close()
  24. outFile.close()