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]