/*
* Hello, you've to compile and run it to get information about me!
*
* Save this code in main.c, GET all other files and run the following command:
* 
* gcc -o program main.c brainfuckinterpreter.c asciititle.c base64.c hero.c -std=c99
* 
* Then run ./program :)
*/

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

/* You need these files, so GET ["/asciititle.h", "/asciititle.c"] */
#include "asciititle.h"
/* You need these files, so GET ["/brainfuckinterpreter.h", "/brainfuckinterpreter.c"] */
#include "brainfuckinterpreter.h"
/* You need these files, so GET ["/base64.h", "/base64.c"] */
#include "base64.h"
/* You need these files, so GET ["/hero.h", "/hero.c"] */
#include "hero.h"

#define SUCCESS 0
#define FAILURE 1

int main(int argc, char **argv)
{
  /* You need this file, so GET ["/hello.bf"] */
  if (print_ascii_title() || // xxd -i used.
      brainfuck_interpreter("hello.bf") || // Esoteric programming language.
      print_hero_message()) { // Obfuscated string.
    fprintf(stderr, "What a bad curriculum!\n");
    return FAILURE;
  }

  printf("\n"); // This is H O R R I B L E. Don't try this at home!

  const char protocol[] = "https://";
  char *base64_contacts[] = {
    "bGlua2VkaW4uY29tL2luL2FsZXNzYW5kcm9pbm5vY2Vuemk=",
    "dHdpdHRlci5jb20vQWxlc2FuY284Mw==",
    "Z2l0aHViLmNvbS9hbGVzYW5jbw==",
    "c2VjanVpY2UuY29tL2F1dGhvci9hbGVzYW5jbw=="
  };

  int contacts_size = sizeof(base64_contacts) / sizeof(base64_contacts[0]);

  char decoded_contact[32] = ""; // Stack Buffer Overflow? Maybe.
  for (size_t i = 0; i < contacts_size; i++) {
    base64_decode(base64_contacts[i], decoded_contact);
    printf("%s%s\n", protocol, decoded_contact);
  }

  return SUCCESS;
}