2. C++ anti-cheating combat (advanced chapter - 18. How to detect and fight against various debuggers)

How to detect and fight various debuggers

In order to deal with crackers debugging our anti-cheat system, we need to detect various debuggers to determine whether our game is being debugged. This article will introduce various common detection methods under ring3 in great detail from shallow to deep.

The supporting sample code for this article is in folder 2.18. If you have already subscribed to this column, please private message me your email in the CSDN official website background to get all the supporting source code. Thank you for your support!

1.IsDebuggerPresent

This function is a standard Windows API, the sample code is as follows:

BOOL WINAPI CheckIsDebug1()
{
	return IsDebuggerPresent();
}

BOOL WINAPI CheckIsDebug2()
{
#ifndef _WIN64
	PPEB pPeb = (PPEB)__readfsdword(0x30);
#else
	PPEB pPeb = (PPEB)__readgsqword(0x60);
#endif // _WIN64

	return pPeb->BeingDebugged;
}

int main()
{
 

Guess you like

Origin blog.csdn.net/wangningyu/article/details/123284118