Skip to content

Instantly share code, notes, and snippets.

@xorhex
Created September 22, 2019 00:41
Show Gist options
  • Save xorhex/4f3c8f6c5a8c6b9228fdb6e22bca57ef to your computer and use it in GitHub Desktop.
Save xorhex/4f3c8f6c5a8c6b9228fdb6e22bca57ef to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import string
secret = []
keys = ['0x8c', '0xf1', '0x53', '0xa3', '0x8', '0xd7', '0xdc', '0x48', '0xdb', '0xc', '0x3a', '0xee', '0x15', '0x22', '0xc4', '0xe5', '0xc9', '0xa0', '0xa5', '0xc', '0xd3', '0xdc', '0x51', '0xc7', '0x39', '0xfd', '0xd0', '0xf8', '0x3b', '0xe8', '0xcc', '0x3', '0x6', '0x43', '0xf7', '0xda', '0x7e', '0x65', '0xae', '0x80']
def hash(var_38, test_char):
return ((var_38 & 0xff) ^ (((((((ord(test_char) ^ 0x33) & 0xFF) + 0x44) & 0xFF) ^ 0x55) & 0xFF) - 0x66) & 0xFF) & 0xFF
var_38 = 0
for key in keys:
print 'key: ' + key + ' var_38: ' + hex(var_38)
s = None
for var in string.printable:
if hex(hash(var_38, var)) == key:
var_38 = var_38 + hash(var_38, var)
print 'Found answer for: ' + key + ' : ' + var
s = var
secret.append(s)
break
if s is None:
print 'Not found for: ' + key
print secret
print ''.join(secret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment