|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Noobrzor Advanced Cheater Reputation: 0
Joined: 19 May 2014 Posts: 74
|
Posted: Fri Aug 21, 2015 8:19 am Post subject: Alloc and Dealloc |
|
|
Greetings
I am puzzled about this, I'd appreciate some clarification.
Hypothetical situation and hypothetical AAscript:
Code: | [ENABLE]
alloc(newmem,2048)
game.exe+fffff:
mov eax,ebx
[DISABLE]
game.exe+fffff:
mov ebx,eax |
1. If I'd repeatedly enable and disable the script, does a new chunk of memory get allocated every time? So after a while (hypothetically) I might end up with thousands of 'newmem's' eating up my memory/disc space?
I wondered about this since the dawn of my adCEnture, so I always added "dealloc(newmem)" at the DISABLE part.
2. I'd been wondering about same-name labels and 'newmems' within several different AAscripts, and how do they intermingle together. Is that a world's biggest ouchie to have same "newmem" and "exampleLabel" in several different AAscripts, being created and used differently each time?
If I'd have two AAscripts, one with alloc(newmem1,2048) and second with alloc(newmem2,2048) as well as dealloc(newmem1), would activating them consecutively disable the first AAscript by stripping away the memory?
If I'd have two AAscripts, both with same "alloc(newmem,2048)", how does the code know to which one of "newmems'" jump to? If both AAScripts are activated, then there are two newmems, no?
Thank you for your time!
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Fri Aug 21, 2015 8:26 am Post subject: |
|
|
1: Yes. without dealloc at disable you'll keep on allocating a new block each time
If you use globalalloc(newmem,2048) though, it'll only allocate it once. (Note that other scripts may not use that name then, else they get the same memory)
2:
alloc and regular labels are "local" symbols. As long as you don't register them (e.g registersymbol) they stay local.
disable has a list of alloc'ed locals, which is why it is capable of deallocating it.
(in fact, disable will ONLY deallocate the memory if all it's alloc's have been reported as dealloc, else it won't deallocate any)
_________________
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 |
|
|
Noobrzor Advanced Cheater Reputation: 0
Joined: 19 May 2014 Posts: 74
|
Posted: Fri Aug 21, 2015 9:23 am Post subject: |
|
|
Thank you, sir.
I shall do my best to absorb your answer.
|
|
Back to top |
|
|
|
|
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
|
|