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 


How to use allocateMemory?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
yazigegeda
Expert Cheater
Reputation: 0

Joined: 22 Jan 2019
Posts: 183

PostPosted: Tue Sep 15, 2020 7:52 am    Post subject: How to use allocateMemory? Reply with quote

Quote:


allocateMemory(size, BaseAddress OPTIONAL, Protection OPTIONAL): Allocates some memory into the target process
deAlloc(address, size OPTIONAL): Frees allocated memory




Can you focus on the Protection OPTIONAL parameter? Sample code is best
:?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue Sep 15, 2020 3:58 pm    Post subject: Reply with quote

Protection uses the Windows allocator constants for memory page protections which can be found here:
https://docs.microsoft.com/en-us/windows/win32/memory/memory-protection-constants

The default, when not given as it is optional, is PAGE_EXECUTE_READWRITE.

An example of that is:
Code:

allocateMemory(1024, 0x00400000, 0x40);


this will attempt to allocate 1024 bytes of memory at, or near, the address of 0x00400000 with the protection flags of 0x40 (PAGE_EXECUTE_READWRITE).

Keep in mind that both the base address and protection are optional parameters and can be ignored unless you require them for some reason. In the majority of cases, you should never need to use them though.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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