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

@@ -1,9 +1,8 @@
import os
import struct
BITS = 56
FLAG = os.getenv("FLAG", "CSCG{TESTFLAG}")
FLAG = os.getenv("FLAG", "CSCG{sH4r1nG_1nt3rn4l_sT4te_1s_d3adLy}")
A = int.from_bytes(os.urandom(BITS//8), "little")
B = int.from_bytes(os.urandom(BITS//8), "little")
@@ -22,7 +21,8 @@ def main():
print("Here are some random numbers, now guess the flag")
rng = gen_random(SEED, BITS, 0xFF)
for i in range(len(FLAG)):
print(next(rng) ^ ord(FLAG[i]))
num = next(rng)
print(num ^ ord(FLAG[i]))
if __name__ == "__main__":
main()