#include "stdafx.h"
#include "ZAntiHack.h"
bool IsAddressHooked(unsigned long address){
BYTE* offsetValue = (BYTE*)address;
return (*offsetValue == 0xE8 || *offsetValue == 0xE9 || *offsetValue == 0x7E || *offsetValue == 0x74 || *offsetValue == 0xC3);
}
void Main(void*)
{
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_LOWEST);
DWORD getTickCount = (DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetTickCount");
DWORD queryPerformanceCounter = (DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "QueryPerformanceCounter");
while(1)
{
Sleep(RandomNumber(5000, 7000));
if (IsAddressHooked(getTickCount) || IsAddressHooked(queryPerformanceCounter) || GetModuleHandleA("hook.dll") != NULL)
{
ExitProcess(NULL);
}
}
}