View previous topic :: View next topic |
Author |
Message |
vng21092 Grandmaster Cheater
Reputation: 15
Joined: 05 Apr 2013 Posts: 644
|
Posted: Fri Oct 23, 2015 8:24 am Post subject: Quick question |
|
|
When and why, should I be using
Code: | label(something)
registersymbol(something) | vs
Code: | globalalloc(something,4) |
|
|
Back to top |
|
 |
PissJar Newbie cheater
Reputation: 0
Joined: 23 Sep 2015 Posts: 13
|
Posted: Fri Oct 23, 2015 8:30 am Post subject: |
|
|
You should be able to find the answer at cheat engine wiki's auto assembler page. I can't post URLs yet so add me on steam or something OR PM ME because the KF2 hack is totally broken and you just WONT respond
|
|
Back to top |
|
 |
STN I post too much
Reputation: 43
Joined: 09 Nov 2005 Posts: 2676
|
Posted: Fri Oct 23, 2015 8:37 am Post subject: |
|
|
PissJar wrote: | You should be able to find the answer at cheat engine wiki's auto assembler page. I can't post URLs yet so add me on steam or something OR PM ME because the KF2 hack is totally broken and you just WONT respond |
lol i doubt you can help him if you can't update a hack yourself.
OP: I recently learned about CE implementation of globalalloc myself so i might be wrong but i don't think you can unregister or free a memory allocated with globallalloc. Whereas, you have that power allocating a memory then using registersymbol.
The only plus side to using globalalloc is it will allocate memory if it was not found (for whatever reason) whereas you have to allocate the memory yourself in a script then you can register and use it in other scripts.
PS: Link to the page he's referring to
http://wiki.cheatengine.org/index.php?title=Cheat_Engine:Auto_Assembler#General_Information
_________________
|
|
Back to top |
|
 |
PissJar Newbie cheater
Reputation: 0
Joined: 23 Sep 2015 Posts: 13
|
Posted: Fri Oct 23, 2015 8:54 am Post subject: |
|
|
STN wrote: | PissJar wrote: | You should be able to find the answer at cheat engine wiki's auto assembler page. I can't post URLs yet so add me on steam or something OR PM ME because the KF2 hack is totally broken and you just WONT respond |
lol i doubt you can help him if you can't update a hack yourself.
OP: I recently learned about CE implementation of globalalloc myself so i might be wrong but i don't think you can unregister or free a memory allocated with globallalloc. Whereas, you have that power allocating a memory then using registersymbol.
The only plus side to using globalalloc is it will allocate memory if it was not found (for whatever reason) whereas you have to allocate the memory yourself in a script then you can register and use it in other scripts.
|
He doesn't have the game(s) so he can't fix the hacks for them. I'm willing to give him family share
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Oct 23, 2015 9:52 am Post subject: |
|
|
Lets say, for example, you have two separate injections.
One injection writes a value to an address identifying that an event has occurred.
The other injection wants to wait for this value before performing some additional action at its location.
Script one may populate a variable with the base address of a unit the player has targeted.
Script two may update the health of ALL units when they take damage.
You want script two to automatically kill a unit, but only if the player has it targeted.
Normally, you would activate script one first to setup the variable and register it.
Only then is it possible to activate script two, which reads from the variable.
Well, with GLOBALALLOC, you can define the address in both scripts.
It only gets initialized by the first script that gets activated.
Now the game won't crash if activated out of order or if one gets disabled.
|
|
Back to top |
|
 |
vng21092 Grandmaster Cheater
Reputation: 15
Joined: 05 Apr 2013 Posts: 644
|
Posted: Fri Oct 23, 2015 10:12 am Post subject: |
|
|
ahhhh I see, I've definitely ran into those problems, that makes sense. So in essence, its basically a combination of alloc, and registersymbol? And STN, I've noticed that you CAN unregister the symbol, but I'm not so sure on the deallocating part. With globalloc it defines (not sure if right word?) its own memory region, whereas registersymbol defines the symbol within the memory region allocated by the cheat. Thanks for help guys.
|
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 62
Joined: 01 Oct 2008 Posts: 958
|
Posted: Fri Oct 23, 2015 11:50 am Post subject: |
|
|
Some note on ALLOC vs GLOBALALLOC for whom may concern:
1. GLOBALALLOC has no address hint, ie. the 3rd parameter of ALLOC. So GLOBALALLOC should always allocate memory below 2g memory space, which may be matter in 64-bit target; <oh,nice DB will added 3rd parameter to GLOBALALLOC http://forum.cheatengine.org/viewtopic.php?t=584970#5623926 >
2. consecutive ALLOC same symbol without DEALLOC cause memory leak,while GLOBALALLOC cannot be de-allocate (aa script DEALLOC(globalallocatedSymbol) will success but the memory still there and can be refer with the symbol);
3. GLOBALLOC will refer same memory address with same symbol and size, but after unregistered the symbol, the new GLOBALALLOC of same symbol MAY allocate another memory address;
4. memory allocated by ALLOC inside a lua assemble command may not be de-allocated by DEALLOC inside another lua assemble command (but sometime it can ~_~)
_________________
- Retarded. |
|
Back to top |
|
 |
|