Skip to content

Instantly share code, notes, and snippets.

@Kvetch
Created May 9, 2017 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kvetch/2ca3e320c61ef20f57cb94020268743f to your computer and use it in GitHub Desktop.
Save Kvetch/2ca3e320c61ef20f57cb94020268743f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
# 6 bytes
inputfile = open('BlahBlahBlah', 'rb')
outputfile = open('output','w+b')
decode = [0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA]
counter = 0
byte = inputfile.read(1)
while byte != "":
#print byte
byte = ord(byte)
byte = byte ^ decode[counter]
counter += 1
if counter > 6:
counter = 0
#print byte
outputfile.write('%c' % byte)
byte = inputfile.read(1)
outputfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment