View previous topic :: View next topic |
Author |
Message |
kitesan Expert Cheater
Reputation: 0
Joined: 01 May 2014 Posts: 124
|
Posted: Wed Sep 16, 2015 4:35 am Post subject: Memory allocation C++ |
|
|
Hello people , is it possible to allocate memory NEXT TO/NEAR the game's code in c++? Cheat engine does that
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Wed Sep 16, 2015 4:58 am Post subject: |
|
|
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 |
|
 |
STN I post too much
Reputation: 43
Joined: 09 Nov 2005 Posts: 2676
|
Posted: Wed Sep 16, 2015 5:57 am Post subject: |
|
|
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.
_________________
|
|
Back to top |
|
 |
kitesan Expert Cheater
Reputation: 0
Joined: 01 May 2014 Posts: 124
|
Posted: Wed Sep 16, 2015 6:06 am Post subject: |
|
|
Thanks
|
|
Back to top |
|
 |
gir489 Grandmaster Cheater
Reputation: 14
Joined: 03 Jan 2012 Posts: 841 Location: Maryland, United States
|
Posted: Wed Sep 16, 2015 8:42 am Post subject: |
|
|
VirtualAlloc if you're on Windows.
malloc if you're on Linux/Mac.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Wed Sep 16, 2015 3:51 pm Post subject: |
|
|
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 |
|
 |
gir489 Grandmaster Cheater
Reputation: 14
Joined: 03 Jan 2012 Posts: 841 Location: Maryland, United States
|
Posted: Wed Sep 16, 2015 3:54 pm Post subject: |
|
|
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 |
|
 |
|