@
miomio
The best way to do this would be to modify the main .exe thread.
Make sure you save the thread handle from CreateThread in the DLL.
Make an external function in the DLL called "isRunning" or something else (make sure you encrypt or hide this function from hackers)
Then make a call to "isRunning" which will check if the DLL's anticheat thread is suspended or terminated.
In the DLL's isRunning function, which will run in the game's main thread, you can check suspension of the anticheat thread by calling
SuspendThread, then immediately calling
ResumeThread. If SuspendThread returns greater than 1, then the thread was previously suspended.
Next, you can check if the thread is terminated with
WaitForSingleObject. If it returns WAIT_TIMEOUT, the thread is still alive. Otherwise, the thread has been terminated.
Then you can just return out of the exe if suspicious thread behavior is detected, or use ExitProcess(int exitCode);