Code:
#include <windows.h>
#include <stdio.h>
BYTE Bypass[7] = {0x73, 0x1E, 0x68, 0x00, 0x00, 0x04, 0x00}; //Byte ON Bypass
BYTE Bypass2[7] = {0x74, 0x1E, 0x68, 0x00, 0x00, 0x04, 0x00}; //Byte OFF Bypass
DWORD Juwendivb = 0;
LPTSTR COD = "MAT.exe"; // Target game
void Patch(void *adr, void *ptr, int size)
{
DWORD NewProtection;
VirtualProtect(adr,size,PAGE_EXECUTE_WRITECOPY, &NewProtection);
memcpy(adr,ptr,size);
VirtualProtect(adr,size,NewProtection, &NewProtection);
}
DWORD WINAPI LoopFunction(LPVOID param)
{
while (1) {
if(GetAsyncKeyState(VK_HOME)&1)//Home Hotkey
{
DWORD Maho = (DWORD)GetModuleHandleA(COD);
{
if (Maho > 0) {
Juwendivb = Maho + 0x266E76; // Pointer Bypass
Patch((void *)(Juwendivb),(void*)(PBYTE)Bypass2, 7); //Byte ON Bypass
Sleep(100);
Patch((void *)(Juwendivb),(void*)(PBYTE)Bypass, 7); // Byte OFF Bypass
}
Sleep(10);
}
}
}
return (0);
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved ) //DLL Main
{
// ngurangin beban kerja dll
DisableThreadLibraryCalls(hDll);
if (dwReason == DLL_PROCESS_ATTACH) {
CreateThread(0, 0, LoopFunction, 0, 0, 0);
}
return TRUE;
}