View previous topic :: View next topic |
Author |
Message |
DerKO How do I cheat? Reputation: 0
Joined: 31 Dec 2017 Posts: 6
|
Posted: Sat Jan 13, 2018 10:16 pm Post subject: Finding unused areas of game memory for personal use |
|
|
I am trying to make a script that does an AOB Injection and allocates new memory. However, I suspect that when I allocate a new place in memory, whenever I try to load in a new world, the game tries to use the same area of memory of which I am already using and crashes. Is there a way to determine a large area of unused game memory for which I can use for my own personal code injections and data storage?
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Sat Jan 13, 2018 10:40 pm Post subject: |
|
|
You can look for "filler" memory that compilers generally use between functions and such depending on how big of an area you need.
Fillers are generally done with either int3 (0xCC) or nop (0x90) instructions. Just depends on the compiler and the settings used when the app was built.
Some may use other things such as 0x00 as filler space but I wouldn't recommend relying on that to be unused.
Search memory for large chunks of either of the above mentioned based on the size you need. You can scan the file itself for large spaces that can be used as static caves as well and just recalculate based on where the area is loaded into memory.
If absolutely needed, you can always just allocate space too instead of trying to reuse already created space.
_________________
- Retired. |
|
Back to top |
|
|
STN I post too much Reputation: 42
Joined: 09 Nov 2005 Posts: 2672
|
Posted: Sun Jan 14, 2018 5:31 am Post subject: |
|
|
Do it the oldskool way by finding code-caves. You can do it on the fly instead of using static addresses.
This is what i did for ACO ( CE couldn't allocate mem near where i was injecting creating far jumps which i didn't want).
aobscanmodule(freespacee,ACOrigins.exe,00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)
This bit is important or you will get nasty crashes - the area you find won't necessarily be writable so we make it
FULLACCESS(freespacee,1000)
You can increase the number of zeroes but chances are if you can find that much free space, it will have a lot more unoccupied space nearby (i constantly managed to find 1-2k+ bytes free area).
You can also search for CC/90s but i don't like that. Always had unpredictable results with that especially on other people's PCs.
You can also look at the end of data/resource sections, always huge amount of free space there.
_________________
|
|
Back to top |
|
|
DerKO How do I cheat? Reputation: 0
Joined: 31 Dec 2017 Posts: 6
|
Posted: Sun Jan 14, 2018 5:56 pm Post subject: |
|
|
Thanks guys
|
|
Back to top |
|
|
|