### creds to adam_i import pysolver w=open('randy').read().split("\n") zz = [] for i in range(0,32): zz.append(int(w[i],16)+1) def rnd(i, state): a = state[i] c = state[(i + 13) & 15] b = (a ^ c ^ (a << 16) ^ (c << 15)) & 0xffffffff c = state[(i + 9) & 15] c ^= c >> 11 a = b ^ c state[(i + 10) & 15] = a d = a ^ ((a << 5) & 3661901092L) i = (i + 15) & 15 a = state[i] a ^= (b ^ d ^ (a << 2) ^ (b << 18) ^ (c << 28)) & 0xffffffff state[i] = a return a problem = pysolver.Problem() state = [] oldstate = [] for i in range(0,16): state.append(pysolver.Int(problem, 32)); oldstate.append(state[i]) wyniki = [] nexty=[] for i in range(0, 32): wyniki.append(rnd((16-i-1)&0xf, state)) wyniki[i].must_be(zz[i]) for i in range(0, 110): nexty.append(rnd((16-i-1)&0xf, state)) problem.solve() base = nexty[1].model & 0xFFFFF000 print hex(base)