All pastes #104494 Raw Edit

Stuff

public text v1 · immutable
#104494 ·published 2006-07-28 22:30 UTC
rendered paste body
HANDLE TheHandle;

export bool thehook(char thename, int address, int newnumber)
{
       HWND TheWind;
       TheWind = FindWindow(thename, NULL);
       DWORD pid;
       GetWindowThreadProcessId(TheWind, &pid);
       TheHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
       WriteProcessMemory(TheHandle, (LPVOID) address, &newnumber, 1, 0);
       return true;
}

/* its supposed to write to the memory address and return true at the end, but it doesnt return true */