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 


Quick question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
vng21092
Grandmaster Cheater
Reputation: 15

Joined: 05 Apr 2013
Posts: 644

PostPosted: Fri Oct 23, 2015 8:24 am    Post subject: Quick question Reply with quote

When and why, should I be using
Code:
label(something)
registersymbol(something)
vs
Code:
globalalloc(something,4)
Back to top
View user's profile Send private message
PissJar
Newbie cheater
Reputation: 0

Joined: 23 Sep 2015
Posts: 13

PostPosted: Fri Oct 23, 2015 8:30 am    Post subject: Reply with quote

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
View user's profile Send private message
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Fri Oct 23, 2015 8:37 am    Post subject: Reply with quote

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

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

Joined: 23 Sep 2015
Posts: 13

PostPosted: Fri Oct 23, 2015 8:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Oct 23, 2015 9:52 am    Post subject: Reply with quote

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
View user's profile Send private message
vng21092
Grandmaster Cheater
Reputation: 15

Joined: 05 Apr 2013
Posts: 644

PostPosted: Fri Oct 23, 2015 10:12 am    Post subject: Reply with quote

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
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 958

PostPosted: Fri Oct 23, 2015 11:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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