|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Fovoc37 How do I cheat? Reputation: 0
Joined: 30 Sep 2018 Posts: 9
|
Posted: Thu May 14, 2020 6:59 am Post subject: WriteProcessMemory, please help |
|
|
Hello guys
How i can write this static address in "WriteProcessMemory":
- "Game.exe+85C74"
WriteProcessMemory(Game.exe, (void*)(0x85C74), &EnableGodMode, 2, 0);
Unfortunately nothing changes
|
|
Back to top |
|
|
DanyDollaro Master Cheater Reputation: 3
Joined: 01 Aug 2019 Posts: 334
|
Posted: Thu May 14, 2020 11:10 am Post subject: |
|
|
Quote: | WriteProcessMemory(Game.exe, (void*)(0x85C74), &EnableGodMode, 2, 0); |
it's totally wrong, Game.exe should be a handle, and 0x85C74 is just the offset to add to the base address of the module, I recommend you to see the documentation of the WriteProcessMemory function.
To get the base address of a module you can use this function:
Code: | #include <Windows.h>
#include <TlHelp32.h>
size_t GetModuleBaseAddress(DWORD ProcessId, const wchar_t* ModuleName)
{
size_t modBaseAddr = 0;
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, ProcessId);
if (hSnap != INVALID_HANDLE_VALUE)
{
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof(modEntry);
if (Module32First(hSnap, &modEntry))
{
do
{
if (!_wcsicmp(modEntry.szModule, ModuleName))
{
modBaseAddr = (size_t)modEntry.modBaseAddr;
break;
}
} while (Module32Next(hSnap, &modEntry));
}
}
CloseHandle(hSnap);
return modBaseAddr;
} |
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|