#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void read_key(char* keybuffer)
{
    FILE* fp = fopen("key.txt", "r");
    fgets(keybuffer, 64, fp);
    fclose(fp);
}

void accept_payment(const char* key)
{
    printf("Send all your precious bitcoins to: 1PWFNCXcUwKHX1WKuIi98ROEzq70NhJBN6\n");
    printf("Only then will we give you your key\n");
}

void main()
{
    setbuf(stdout, NULL);

    char key[64];
    char answer[64];

    read_key(key);

    printf("You have been PWNED by Scr1ptk1dd13!!!\n");
    printf("This state of the art malware has encrypted all your files and you will only get the key when you pay us moehahahaha\n");

    printf("So will you pay us? [yes/no] > ");
    fgets(answer, 64, stdin);

    printf("Your answer was: ");
    // Please compiler, do not compile this down to a puts
    printf(answer);
    
    if (strcmp(answer, "yes\n") == 0) {
        accept_payment(key);
    } else {
        printf("Okay loser, have fun without a server\n");
    }
}