Last active
May 6, 2020 20:20
-
-
Save equalent/1f9e7fc51d94eaa298684c27258af2ee to your computer and use it in GitHub Desktop.
Detect running Cheat Engine (simple anti-cheat)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <Psapi.h> | |
#include <TlHelp32.h> | |
#include <string.h> | |
BOOL IsCheatEngineRunning() | |
{ | |
PROCESSENTRY32 pe32 = { sizeof(PROCESSENTRY32) }; | |
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | |
if (hSnapshot == INVALID_HANDLE_VALUE) | |
return FALSE; | |
if (Process32First(hSnapshot, &pe32)) | |
{ | |
do { | |
if ((strcmp(pe32.szExeFile, "cheatengine-i386.exe") == 0)||(strcmp(pe32.szExeFile, "cheatengine-x86_64.exe") == 0)) | |
{ | |
CloseHandle(hSnapshot); | |
return TRUE; | |
} | |
} while (Process32Next(hSnapshot, &pe32)); | |
} | |
CloseHandle(hSnapshot); | |
return FALSE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment