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 


How to get App multi address in LUA

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
mindoff
Advanced Cheater
Reputation: 0

Joined: 12 Jun 2016
Posts: 96

PostPosted: Tue Jul 04, 2017 6:52 am    Post subject: How to get App multi address in LUA Reply with quote

Cheat Table can save some green pointer address like

"aa.exe"+00A935C8
with offset 21E1c

the offset address is const

say it's a position variable,how can I use this address in LUA?
I need to read and write this value automatic.

Right now I just hard code the address every time,because I don't know how to load this address in LUA
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Tue Jul 04, 2017 8:10 am    Post subject: Reply with quote

Code:
address = "[aa.exe+00A935C8]+21E1c"


Yes, it's really that simple Smile
Back to top
View user's profile Send private message
mindoff
Advanced Cheater
Reputation: 0

Joined: 12 Jun 2016
Posts: 96

PostPosted: Tue Jul 04, 2017 9:47 am    Post subject: Reply with quote

FreeER wrote:
Code:
address = "[aa.exe+00A935C8]+21E1c"


Yes, it's really that simple Smile

Isn't this a string?And try other combination,not working... Sad

OK,got it.Thank you very much. Very Happy

test = getAddress("[aa.exe+00A935C8]+21E10")
print(test)
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Tue Jul 04, 2017 10:58 am    Post subject: Reply with quote

Yes that's a string, any CE function that wants an address can take it as a string and it'll do the translations to figure out what the real numeric address is, that way you can use registerSymbol to register say, "playerbase" as a symbol that represents the real address in memory and use "[playerbase+4]" as the address of the health for example or simply the module name plus an offset like "aa.exe+00A935C8"

Yes, you can use getAddress to have CE return the numeric address to you so that you can do typical lua math with it, do note that if that address does not exist for some reason getAddress will call the error function causing the script to stop if you haven't set the errorOnLookupFailure to false (in which case it returns 0) or used pcall. In CE 6.7 you can use GetAddressSafe which simply returns nil if the translation fails.
Back to top
View user's profile Send private message
mindoff
Advanced Cheater
Reputation: 0

Joined: 12 Jun 2016
Posts: 96

PostPosted: Tue Jul 04, 2017 9:28 pm    Post subject: Reply with quote

thank you again,I will add error handle right now.
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