``` i = 0 enc = open("data.bin", "rb") size = len(enc) offset = 4 dec = bytearray() while offset < size: if i == 0: val = int.from_bytes(enc[offset:offset+2], 'little') offset += 2 c = 16 if (val & 1) != 0: v8 = (enc[offset] & 0xf0) << 4 v7 = (enc[offset] & 0xf) + 1 v9 = v8 + enc[(offset + 1)] offset += 2 pos = len(dec) - v9 for j in range(v7): dec.append(dec[pos + i]) else: dec.append(enc[offset]) offset += 1 val >>= 1 c -= 1 print(dec) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up