 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
ginocapo How do I cheat?
Reputation: 0
Joined: 01 Mar 2012 Posts: 6
|
Posted: Mon Mar 05, 2012 10:37 am Post subject: [HELP]C++ Writing Process Memory |
|
|
Hello everybody , i was using DevCPP to making my own trainer, but i have a problem here. I dont know how to write process memory an FLOAT value,
using this function:
WriteProcessMemory(process, address, value, size, null)
i just cant write a float value, so i need you help ! THX
(tell me what is wrong): this is my code:
DWORD addr2 = gameBase + 0x971D0C;
float valor = 0x10;
WriteProcessMemory(hProc, LPVOID(addr2), &valor, 4, NULL);
and the value dosnt change!
|
|
| Back to top |
|
 |
ginocapo How do I cheat?
Reputation: 0
Joined: 01 Mar 2012 Posts: 6
|
Posted: Sun Mar 11, 2012 11:41 am Post subject: i found it |
|
|
Hello, i only wanna say that i made the code works, my function for write Floating memory values is this:
| Code: |
static void WriteFloat(LPVOID Address, float Data)
{
unsigned long protect;
VirtualProtectEx(hProc, (void*)Address, 4,PAGE_EXECUTE_READWRITE, &protect);
if (!WriteProcessMemory(hProc, (LPVOID)Address, &Data, sizeof(float), &dSize))
{
system("color C");
system("cls");
printf("Error writing process memory!");
getch();
}
VirtualProtectEx(hProc, (void*)Address, 4, protect, &protect);
}
|
// where hProc is the open process.
and you call in this way:
| Code: |
DWORD YOURADDRESS = 0x0000000;
float YOURFLOATVALUE = 00;
WriteFloat(LPVOID(YOURADDRESS), YOURFLOATVALUE);
|
Thanks anyway. [/code]
|
|
| 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
|
|