-
-
Save balidani/a1984630ee905a418610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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