#include "anti_emuauth.h"

#include "../webhook/webhook.h"
#include "kill_process.h"

#include <iostream>
#include <fstream> 
#include <string>
#include <thread>

void AntiEmulator() 
{
    bool emulatorDetected = false;

    while (true) {
        std::ifstream file("C:\\Windows\\System32\\drivers\\etc\\hosts");
        std::string str;

        while (std::getline(file, str)) {
            if (str.find("keyauth.win") != std::string::npos) {
                emulatorDetected = true;
            }
        }

        if (emulatorDetected) {
            //webhook::sendLog("EmuAuth");
            std::this_thread::sleep_for(std::chrono::milliseconds(3000));
            blue_screen();
            exit(1);
        }

        std::this_thread::sleep_for(std::chrono::milliseconds(5000));
    }
}