nullcon2023-chall-spygame

Python C-binding object leak challenge for NullCon 2023 Berlin
git clone https://git.sinitax.com/sinitax/nullcon2023-chall-spygame
Log | Files | Refs | sfeed.txt

game.py (855B)


      1#!/usr/bin/env python3
      2
      3import spy
      4from secret import flag
      5
      6print("Lets play a simple game!");
      7print("");
      8print("I'll give you a list of numbers, and you need to spy with");
      9print("your little eye which two numbers in the list are swapped");
     10print("as fast as possible!");
     11print("");
     12
     13while True:
     14    print("--- New Game ---")
     15    print()
     16
     17    mode = input("Easy or Hard? ")
     18    if mode.strip().lower() == "hard":
     19        result = spy.hard()
     20    elif mode.strip().lower() == "easy":
     21        result = spy.easy()
     22    else:
     23        break
     24
     25    if result == "REWARD":
     26        print("Wow, you are really good. You deserve a reward!")
     27        print("Here is a flag for you troubles:", flag)
     28    elif result == "MOTIVATE":
     29        print("Not too shabby. Try out the hard mode next!")
     30    else:
     31        print("Sorry, too slow. Better luck next time!")
     32    print()