import zlib, sys def main(args): f = file(args[0], 'rb').read() size = len(f) i = 0 while i < size: try: de = zlib.decompress(f[i:]) except zlib.error: i += 1 continue print 'Found a compressed block starting at', i i += 1 if __name__=='__main__': sys.exit(main(sys.argv[1:]))
Found a compressed block starting at 4 Found a compressed block starting at 1370 Found a compressed block starting at 51781 Found a compressed block starting at 51905 Found a compressed block starting at 52283 Found a compressed block starting at 52401
import zlib, sys try: import psyco psyco.full() except ImportError: pass def main(args): f = file(args[0], 'rb').read() size = len(f) i = 0 slen = 0 while i < size: try: slen = len(zlib.decompress(f[i:])) except zlib.error: print i i += 1 continue start = i while i < size: try: slen2 = len(zlib.decompress(f[start:i])) except zlib.error: i += 1 continue if slen == slen2: break i += 1 print 'Found:', start, i - start if __name__=='__main__': sys.exit(main(sys.argv[1:]))
Found: 4 1362 Found: 1370 50407 Found: 51781 120 Found: 51905 374 Found: 52283 114 Found: 52401 145
import zlib, struct, sys try: import psyco psyco.full() except ImportError: pass def main(args): fp = file(args[0], 'rb') i = 1 while True: data = fp.read(4) if len(data) != 4: break length = struct.unpack('<L', data)[0] file('block_%i.dat' % i, 'wb').write(zlib.decompress(fp.read(length))) i += 1 if __name__=='__main__': sys.exit(main(sys.argv[1:]))
import zlib, struct, os, sys try: import psyco psyco.full() except ImportError: pass def main(args): fp = file(args[0], 'rb') data = fp.read(4) while len(data) == 4: l = struct.unpack('<L', data)[0] data2 = fp.read(l) data = fp.read(4) if len(data) != 4: try: filenameblock = zlib.decompress(data2) except ImportError: filenameblock = data2 fnblocksize, fncount = struct.unpack('<LL', filenameblock[:8]) filenameblock = filenameblock[8:] try: os.mkdir(args[1]) except OSError: pass for i in range(fncount): block_start, block_len, fnlen = struct.unpack('<LLL', filenameblock[:12]) filename = filenameblock[12:12 + fnlen] paths = filename.split('/')[:-1] path = args[1] for dir in paths: path += '/' + dir try: os.mkdir(path) except OSError: pass print filename f = file(args[1] + '/' + filename, 'w') fp.seek(block_start + 4) d = fp.read(block_len) try: d = zlib.decompress(d) except zlib.error: pass f.write(d[12 + len(filename):]) f.close() filenameblock = filenameblock[12 + fnlen:] if __name__=='__main__': sys.exit(main(sys.argv[1:]))
There are 31,321 total registered users.
[+] expand