Last active
May 13, 2021 03:09
-
-
Save MikuAuahDark/3f436b63ad9b272aa989be115193c001 to your computer and use it in GitHub Desktop.
GTASA Cheat Input Disable
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
/* | |
* Prevents you from using cheat codes like HESOYAM, DDDDDDDAAAAAADWD, ... | |
* Only tested on gta-sa.exe US 1.0 HOODLUM and COMPACT. | |
* Please change address at line 13 if you're not using US v1.0 executable | |
* | |
* Compile with | |
* clang -m32 -shared -o nocheat.asi nocheat.c | |
*/ | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
int setCheatEnable(int enable) | |
{ | |
static unsigned char *address = (unsigned char *) 0x438480; | |
DWORD oldProt, temp; | |
if (VirtualProtect(address, 1, PAGE_READWRITE, &oldProt)) | |
*address = enable ? 0xC3 : 0xA0; | |
else | |
return 0; | |
VirtualProtect(address, 1, oldProt, &temp); | |
return 1; | |
} | |
int __stdcall DllMain(HINSTANCE _, DWORD reason, LPVOID __) | |
{ | |
return setCheatEnable(reason == DLL_PROCESS_ATTACH || reason == DLL_THREAD_ATTACH); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment