Fire218 How do I cheat?
Reputation: 0
Joined: 24 Jan 2013 Posts: 1 Location: Deutschland
|
Posted: Thu Jan 24, 2013 10:08 am Post subject: [C++] Using pointers from Cheat engine |
|
|
Hello,
i try to get a Value of a Memory -> Pointer
thats what I do in Cheat Engine:
How do I get this Work in my C++ Function:
Code:
| Code: |
void _sendchat(char* text)
{
int ProcessID = 0, Len = strlen(text) + 1;
for (ProcessID = 0; !ProcessID; ProcessID = GetProcessID("gta_sa.exe"))
;
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessID);
if (hProcess)
{
PVOID cmd = VirtualAllocEx(hProcess, 0, Len, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
WriteProcessMemory(hProcess, cmd, text, Len, 0);
DWORD func = (DWORD)GetModuleHandleExtern("samp.dll", ProcessID) + 0x4A10;
HANDLE hThread = CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE)func, cmd, 0, 0);
DWORD dwExitCode = 0;
if (hThread)
{
WaitForSingleObject(hThread, INFINITE);
GetExitCodeThread(hThread, &dwExitCode);
}
VirtualFreeEx(hProcess, cmd, Len, MEM_RELEASE);
CloseHandle(hThread);
}
CloseHandle(hProcess);
}
|
It dont work in this Function, please help...
Thanks
Dennis
|
|