z3 training

This commit is contained in:
2025-11-28 12:23:07 +01:00
parent dc96452364
commit 9144e50e85
11 changed files with 910 additions and 17 deletions

View File

@@ -19,13 +19,11 @@ def ROR(X, N):
return ((((X) >> (N)) | ((X) << (64 - (N)))) % (2 ** 64))
def custom_random(state):
NEW_STATE = ROL(state,30) ^ ROR(state,12) ^ ROL(state,42) ^ ROL(state,4) ^ ROR(state,5);
return NEW_STATE % 256, NEW_STATE;
NEW_STATE = ROL(state,30) ^ ROR(state,12) ^ ROL(state,42) ^ ROL(state,4) ^ ROR(state,5)
return NEW_STATE % 256, NEW_STATE
pwn.context.arch = 'x86_64'
shc = pwn.asm("""
cdq;
push rdi;
@@ -35,8 +33,6 @@ shc = pwn.asm("""
syscall
""")
def get_seed_for_sequence(bytesequence):
s = z3.Solver()
base_state = z3.BitVec("base_state", 64)