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 


Change an address based on a variable defined in Cheat Table

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Tue Aug 06, 2019 7:35 am    Post subject: Reply with quote

The simple way would be to create a memory record with the base address as it's address and then nest everything based on it under it so that it's intended a bit and as the address use +offset eg +4, it would then be added to the address of the parent, the character in this case. Then you just have to have the user change the address.

Though you can register a symbol named CharacterBaseAddress and use it in an address just like module names eg. CharacterBaseAddress+4 or [CharacterBaseAddressPtr]+4 and you can refer to global lua variables using $CharacterBaseAddress+0x4 (at least iirc the $ turns the entire address into a lua expression, I don't use it too often so I don't remember for sure however).

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Tue Aug 06, 2019 9:39 am    Post subject: Reply with quote

Quote:
how do i get access to the addresslist in assembly? Am i approaching this wrong?
you generally don't, you register symbols and use static address and offsets to access things from assembly in the addresslist.

Registering a symbol doesn't require lua it's done all the time in the assembly scripts, it's just registerSymbol(label_thats_at_the_address_you_want). Though you can also do it in lua with registerSymbol('name', whateverAddressValue). Then you just use the name in the addresslist, module names eg "Tutorial-i386.exe" are symbols that CE automatically registers for you, all you're doing is creating your own.

Of course the first option with nesting records in the address list doesn't require assembly at all if you have a pointer to the character(s).

_________________
https://github.com/FreeER/ has a few CE related repos
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 Lua Scripting 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