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 


Memory allocation C++

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

Joined: 01 May 2014
Posts: 124

PostPosted: Wed Sep 16, 2015 4:35 am    Post subject: Memory allocation C++ Reply with quote

Hello people , is it possible to allocate memory NEXT TO/NEAR the game's code in c++? Cheat engine does that
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Wed Sep 16, 2015 4:58 am    Post subject: Reply with quote

VirtualAllocEx
give it a base address dividable by 64KB and currently not allocated

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Wed Sep 16, 2015 5:57 am    Post subject: Reply with quote

Look at CE source code (i forgot the particular unit, probably autoassembler ?) to see how CE looks for unallocated compatible memory region. Just search for virtualallocex/writeprocessmemory with notepad++ etc in all files in CE directory and you will stumble upon that piece of code.

I have been meaning to release my 64 bit version of trainer engine (both c++/delphi), just haven't been finding the time or motivation to release it.

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
kitesan
Expert Cheater
Reputation: 0

Joined: 01 May 2014
Posts: 124

PostPosted: Wed Sep 16, 2015 6:06 am    Post subject: Reply with quote

Thanks
Back to top
View user's profile Send private message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 841
Location: Maryland, United States

PostPosted: Wed Sep 16, 2015 8:42 am    Post subject: Reply with quote

VirtualAlloc if you're on Windows.

malloc if you're on Linux/Mac.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Wed Sep 16, 2015 3:51 pm    Post subject: Reply with quote

On linux I'd go for mmap instead (No idea about mac. Perhaps it has mmap, else mach_stuff )
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 841
Location: Maryland, United States

PostPosted: Wed Sep 16, 2015 3:54 pm    Post subject: Reply with quote

Dark Byte wrote:
On linux I'd go for mmap instead (No idea about mac. Perhaps it has mmap, else mach_stuff )

I always call malloc from the runtime with my x86 payloads. It's a runtime function you can guarantee it will be there on any platform. If I know the platform is windows (using a windows-specific exploit), I call VirtualAlloc.

We're not doing heckler stuff here, so I guess go for more platform optimized functions. But my *nix experience is very limited. I go with what works.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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