Skip to content

Instantly share code, notes, and snippets.

@balidani
Created September 21, 2014 15:16
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 balidani/a1984630ee905a418610 to your computer and use it in GitHub Desktop.
Save balidani/a1984630ee905a418610 to your computer and use it in GitHub Desktop.
def read_chunk(f):
global data
chunk_type = ord(f.read(1))
if chunk_type % 2 == 1:
chunk_size = chunk_type >> 1
data.append(f.read(chunk_size))
orig_data.append(orig.read(chunk_size))
return True
else:
chunk_hash = f.read(2).encode('hex')
chunk_size = chunk_type >> 1
# print "Chunk type: %02x %s, id: %d" % (chunk_type, chunk_hash, len(data))
data.append("\x00" * chunk_size)
return True
f = open('key.csawlz', 'rb')
orig = open('csawlz_source.html', 'rb')
f.read(0x2c)
data = []
orig_data = []
try:
while read_chunk(f):
pass
except Exception:
pass
open('outkey.jpg', 'wb').write(''.join(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment