Recent Cheat Engine hacks. Programmers: How to stop them.

closed account (18hRX9L8)
I don't know if you guys know about Cheat Engine, but it's pretty powerful (if you know how to use it.) Anyways, recently, in this massive online FPS game I play (Uberstrike), there have been thousands of people using Cheat Engine to hack weapon abilities. I have devised this simple solution to counter the issue.

For those of you who are building games in C++ right now, this could be useful.

This simple code checks all the windows open and finds any with part of the title being "Cheat Engine" and then tells the user if he/she is a hacker or not. Currently, this would only work on Windows, so I am going to convert this code to Python.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <windows.h>
#include <string.h>

BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) {
	char title[80];
	std::string str (title);
	std::string stk ("Cheat Engine");
	
	GetWindowText(hwnd,title,sizeof(title));
	str = title;
	
	std::size_t found = str.find(stk);
	if(found!=std::string::npos) {
		return FALSE;
	}
	
	return TRUE;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pCmdLine, int iCmdShow) {
	BOOL chk = EnumWindows(EnumWindowsProc, NULL);
	
	if(chk == FALSE) {
		std::cout << "YOU ARE A HACK!";
	} else {
		std::cout << "YOU ARE GOOD!";
	}
	
	// continue to play game ...
	
	return 0;
}


If you have any comments or even better ways to counter Cheat Engine / other ways to hack, please feel free to post!

Also, if you think there is a problem with this please post so I can try to counter those as well.

Thanks for your attention,
Usandfriends

[Edit] This only works if your games are downloadable (not online). [/Edit]
Last edited on
What if I say, have this webpage open. The name of this topic would flag me as cheating :(

Sadly, countering cheaters isn't as easy as this. Spoofing window titles isn't hard either.
closed account (N36fSL3A)
Well you would check if it first letters are "Che" etc.
closed account (Dy7SLyTq)
@fred: that doesn't matter. as rb said, it will flag for other things such as this webpage and you can change the window title easily
closed account (N36fSL3A)
How?
closed account (Dy7SLyTq)
how what?
closed account (18hRX9L8)
Good thinking Resident!
Quick Fix: Check for the class.

New code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <windows.h>
#include <string.h>

BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) {
	char title[80];
	char class_name[80]; // edit here
	std::string str (title);
	std::string stk ("Cheat Engine");
	
	GetWindowText(hwnd,title,sizeof(title));
	GetClassName(hwnd,class_name,sizeof(class_name)); // edit here
	str = title;
	
	std::size_t found = str.find(stk);
	if(found!=std::string::npos && !strcmp(class_name,"Window")) { // edit here
		return FALSE;
	}
	
	return TRUE;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pCmdLine, int iCmdShow) {
	BOOL chk = EnumWindows(EnumWindowsProc, NULL);
	
	if(chk == FALSE) {
		std::cout << "YOU ARE A HACK!";
	} else {
		std::cout << "YOU ARE GOOD!";
	}
	
	// continue to play game ...
	
	return 0;
}


Just tested on Chrome, Nightly, Firefox.
Also tested it by creating a Hello world program and named it "Cheat Engine". Still works!
Last edited on
closed account (N36fSL3A)
If it is open source you can check if a certain process during the program is running.
You realize your cheater friends have to actually run this code for it to print a message to a console window somewhere...

Or am I missing something?
closed account (N36fSL3A)
I see you finally commented again. Now you don't have 69 69 posts anymore. (If I were you I'd just make a new account called Duoas2.

(Referencing Catfish)
closed account (Dy7SLyTq)
this was going to be the highlight of my day duoas. thanks for ruining it
closed account (1yR4jE8b)
@Duoas

I thought the same thing as you at first, then I realized it's for game developers to put in their own games to implement a rudimentary form of anti-cheating in the game itself -- not to catch other people you are playing with cheating.
closed account (18hRX9L8)
Thank you darkestfright for explaining.
Last edited on
Topic archived. No new replies allowed.