Skip to content

Instantly share code, notes, and snippets.

@Becojo
Created July 30, 2017 21:35
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 Becojo/12a48af57e76399a42234a9dc92f53b8 to your computer and use it in GitHub Desktop.
Save Becojo/12a48af57e76399a42234a9dc92f53b8 to your computer and use it in GitHub Desktop.
from z3 import *
def C03011(Qml5):
C12d =0
for Po4M in Qml5:
C12d = (31 * C12d + (Po4M)) & 0xFFFFFFFF
return ((C12d + 0x80000000) & 0xFFFFFFFF) - 0X80000000
username = [BitVec('u' + str(i), 32) for i in range(6)]
s = Solver()
s.add(C03011(username) == -1133886720)
for u in username:
s.add(u >= 0x20)
s.add(u < 0x7f)
s.add(username[0] != 109) # uncomment to find a password
s.check()
m = s.model()
print ''.join([chr(int(str(m[u]))) for u in username])
# username: m(tm6b
# password: lGtkuC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment