Skip to content

Instantly share code, notes, and snippets.

@hasherezade
Created July 13, 2015 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasherezade/430ecbdf2dd1f0d935be to your computer and use it in GitHub Desktop.
Save hasherezade/430ecbdf2dd1f0d935be to your computer and use it in GitHub Desktop.
Bunitu Proxy - decoding scripts
#!/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)
#!/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