CONST_XOR = 0x5A TARGET = 0xdeadbeef SIZE = 64
if (chk == 0xdeadbeef) // Success path – print the flag stored in the binary puts(flag); return 0; return -1; el capo 2 cap 57
open("key.bin","wb").write(key)
T[i] = rotl8( key[i] ^ 0x5A , i % 8 ) We want Σ T[i] = 0xdeadbeef (mod 2^32) . Because the checksum is a simple sum, we can freely pick the first 63 bytes and solve for the last byte. CONST_XOR = 0x5A TARGET = 0xdeadbeef SIZE =
# Write to file with open("key.bin", "wb") as f: f.write(key) "wb") as f: f.write(key)