Instantly share code, notes, and snippets.

@Newbrict / Secret
Created Mar 19, 2015

What would you like to do?
Decodes the password for tw33tchainz binary
import sys
# get command line args
hexString = sys.argv[1]
# split it up by word size
splitSize = 8
words = [hexString[i:i+splitSize] for i in range(0, len(hexString), splitSize)]
# flip each word to account for little endian encoding
little_endian = []
splitSize = 2 # len of byte
for w in words:
splitByte = [w[i:i+2] for i in range(0, len(w), 2)]
splitByte = splitByte[::-1]
for byte in splitByte:
# convert to little endian and add to str
# apply our changes to each byte
secret = []
for i in little_endian[:-1]:
if i % 2 == 0:
secret.append(((i+2) % 256))
secret = ''.join([chr(c) for c in secret])
secret += chr(little_endian[-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment