-
-
Save ius/decb73bf9749915d3368218d00eed20c 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
#!/usr/bin/env python3 | |
import struct | |
import sys | |
def xor(a, b): | |
return bytes(x ^ y for x, y in zip(a, b)) | |
def cipher_stream(state, length): | |
output = b'' | |
for i in range(0, length, 4): | |
output += struct.pack('>I', state) | |
state = (state + (state >> 0x1a | state << 0xe)) & 0xffffffff | |
return output[:length] | |
state = 0x967e9839 | |
brd = open(sys.argv[1], 'rb').read() | |
data = xor(brd, cipher_stream(state, len(brd))) | |
open(sys.argv[2], 'wb').write(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment