pythonchallenge Level 21
隐藏在20关中
import zlib,bz2 file = open("./readme/package.pack",'rb').read() print(file) def unwrap(data): while True: if data.startswith(b'x\x9c'): data = zlib.decompress(data) elif data.startswith(b'BZh'): data = bz2.decompress(data) elif data.endswith(b'\x9cx'): data = data[::-1] else: return data print(unwrap(file)) # b'sgol ruoy ta kool' print(unwrap(file)[::-1]) # b'look at your logs' def unwrap(data): result = "" while True: if data.startswith(b'x\x9c'): data = zlib.decompress(data) result += ' ' elif data.startswith(b'BZh'): data = bz2.decompress(data) result += '#' elif data.endswith(b'\x9cx'): data = data[::-1] result += '\n' else: print(result) return data unwrap(file)
这关没搞懂,根据资料拿到下一关地址copper
本文来自博客园,作者:OTAKU_nicole,转载请注明原文链接:https://www.cnblogs.com/nicole-zhang/p/15563722.html