Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[HELP]C++ Writing Process Memory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
ginocapo
How do I cheat?
Reputation: 0

Joined: 01 Mar 2012
Posts: 6

PostPosted: Mon Mar 05, 2012 10:37 am    Post subject: [HELP]C++ Writing Process Memory Reply with quote

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
View user's profile Send private message
ginocapo
How do I cheat?
Reputation: 0

Joined: 01 Mar 2012
Posts: 6

PostPosted: Sun Mar 11, 2012 11:41 am    Post subject: i found it Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites