#pragma once
 
/*
	Bliblioteka hooks detector
	Autor: Regz.pl
 
	Przykład:
		while (true)
		{
			if(hooks_detector::check())
				MessageBox(NULL, "Znaleziono hook", "Błąd", MB_OK);
 
			Sleep(15);
		}
 
	Test:
		Uruchom Cheat Engine i wstrzyknij speedhack a funkcja check zwróci prawdę.
*/
 
#include <Windows.h>
#include <vector>
 
namespace hooks_detector
{
	static std::vector<BYTE*> functions {
		(BYTE*)GetTickCount, (BYTE*)GetTickCount64, (BYTE*)QueryPerformanceCounter, (BYTE*)QueryPerformanceFrequency
	};
 
	int check()
	{
		for (auto function : functions)
		{
			if (function[0] == 0xE9 || function[0] == 0x90 || function[0] == 0xC3 || (function[0] == 0xFF && function[1] == 0x25))
				return 1;
		}
		return 0;
	}
}