-
-
Save hasherezade/430ecbdf2dd1f0d935be to your computer and use it in GitHub Desktop.
Bunitu Proxy - decoding scripts
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/python | |
FILENAME = "dalookerzmeoajrhja144" | |
KEY = "dalookerzmeoajrhja144" | |
MAX_KEY_LEN = 0xA | |
def decode1(data, key, max_key): | |
l = len(key) | |
j = 0 #key index | |
decoded = bytearray() | |
for i in range(0, len(data)): | |
decoded.append(data[i] ^ key[j % l]) | |
if (i > 0): | |
j += 1 | |
if (j == max_key): | |
j = 0 | |
return decoded | |
data = bytearray(open(FILENAME, 'rb').read()) | |
key = bytearray(KEY) | |
print decode1(data, key, MAX_KEY_LEN) |
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/python | |
FILENAME = "UncryptedStub._ini" | |
KEY = "9JKjPZSpEL8uHmkHNlXhwhDc9jRTGN" | |
MAX_KEY_LEN = 0x1E | |
def decode2(data, key, max_key): | |
j = 0 #key index | |
prev_j = 0 | |
decoded = bytearray() | |
for i in range(0, len(data)): | |
val = data[i] + prev_j | |
val = ((val ^ key[j]) ^ key[prev_j]) % 256 | |
decoded.append(val) | |
prev_j = j | |
j = j + 1 | |
if (j == max_key): | |
j = 0 | |
return decoded | |
data = bytearray(open(FILENAME, 'rb').read()) | |
key = bytearray(KEY) | |
print decode2(data, key, MAX_KEY_LEN) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment