import base64
import random
import sys
import time
import os
TEMEL_ISLEM_LISTESI = [64060, 7054, 40202, 20095, 13233, 27229, 11339, 32665, 40961, 4660, 43981, 39304, 4386, 13124, 21862, 30600] * 30
MESAJ_KUTUSU = ['Veri Giriniz: ', 'Hata: 0x99', 'Onay Kodu: 0xCF', 'Islem Baslatiliyor...', 'Kritik Hata: 0xFF']
def islem_A(a, b):
return a ^ b
def islem_B(a, b):
return a + b
def islem_C(a, b):
return a - b
def islem_D(a, b):
return a * b
FONKSIYON_KUTUSU = {random.randint(1000, 9999): islem_A, random.randint(1000, 9999): islem_B, random.randint(1000, 9999): islem_C, random.randint(1000, 9999): islem_D}
ILK_SIR_ANAHTAR = list(FONKSIYON_KUTUSU.keys())[0]
KARTON_ICINDEKI_MANTIK = '\nZGVmIHRlbWVsc2VjcmV0X2NvbnRyb2xfY2x1ZGUoYykscmV0dXJuIGNbOTo9ID09ICJfNDUxOV9H\nTE9CQUxDSGFUX1RSIg==\n'
XOR_DEGISKENI = 66
def cozumle_kagit(veri, anahtar):
b64_cozum = base64.b64decode(veri.encode('utf-8'))
cozulen_baytlar = bytes([b ^ anahtar for b in b64_cozum])
return cozulen_baytlar.decode('utf-8')
def kontrol_safha_bir(girdi):
if len(girdi) != 27:
return False
hedef_toplam = 40051
guncel_toplam = 0
for i in range(8):
deger = ord(girdi[i])
deger = FONKSIYON_KUTUSU[ILK_SIR_ANAHTAR](deger, i)
guncel_toplam += islem_D(deger, i + 1)
if abs(guncel_toplam - hedef_toplam) > 10:
return False
return True
def hiz_kontrolu():
saat_baslangic = time.time()
for _ in range(200000):
continue
saat_bitis = time.time()
gecen_saniye = saat_bitis - saat_baslangic
if gecen_saniye > 0.05:
print(MESAJ_KUTUSU[4])
os._exit(0)
def ana_gorev():
hiz_kontrolu()
girdi = ''
akim_durumu = 0
while True:
if akim_durumu == 0:
print(MESAJ_KUTUSU[0], end='')
girdi = sys.stdin.readline().strip()
akim_durumu = 1
elif akim_durumu == 1:
random.shuffle(TEMEL_ISLEM_LISTESI)
_ = FONKSIYON_KUTUSU[list(FONKSIYON_KUTUSU.keys())[1]](12345, 67890)
akim_durumu = 2
elif akim_durumu == 2:
if kontrol_safha_bir(girdi):
print(MESAJ_KUTUSU[2])
akim_durumu = 3
else:
print(MESAJ_KUTUSU[1])
akim_durumu = 99
else:
if akim_durumu == 3:
print(MESAJ_KUTUSU[3])
try:
cozulen_kod = cozumle_kagit(KARTON_ICINDEKI_MANTIK, XOR_DEGISKENI)
exec(cozulen_kod)
if 'temelsecret_kontrol_clued' in globals():
if globals()['temelsecret_kontrol_clued'](girdi):
print('\n[OK] Islem Tamamlandi.')
print(f'[FLAG] {girdi}')
akim_durumu = 100
else:
print(MESAJ_KUTUSU[1])
akim_durumu = 99
else:
print(MESAJ_KUTUSU[1])
akim_durumu = 99
except Exception as e:
print(MESAJ_KUTUSU[1])
akim_durumu = 99
if akim_durumu == 99:
sys.exit(1)
elif akim_durumu == 100:
sys.exit(0)
else:
print(MESAJ_KUTUSU[4])
sys.exit(2)
if __name__ == '__main__':
ana_gorev()