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 use AOB in Lua?

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

Joined: 19 Apr 2023
Posts: 31

PostPosted: Fri Nov 03, 2023 4:32 am    Post subject: How to use AOB in Lua? Reply with quote

In the game I found an address that is responsible for the player’s health.
The problem is that the instruction that does this is also responsible for the operation of more than 2000 addresses. The instructions are in lua51.dll.

How can I add AOB to get the player's health address if this instruction works with 2000 more addresses?
Back to top
View user's profile Send private message
mrjunior
Newbie cheater
Reputation: 1

Joined: 07 Jul 2018
Posts: 12

PostPosted: Sat Nov 04, 2023 8:16 am    Post subject: Reply with quote

To begin with 2000 addresses is a lot and I would recommend looking for other instruction (unless you know there are 1999 entities currently loaded).
If you got the right instruction, imagine you have operation like this
Code:
mov ebp,[eax+B0]

You know that eax is the address to the structure and B0 is the HP offset. Click "Find out what addresses this instruction accesses". You get a list of addresses, right click on player's address -> "Find commonalities between addresses" -> "Mark as group 1". Select the rest and mark as Group 2. Then go for "Find commonalities between addresses" -> "Scan for commonalities". Choose the register that contains the address (in my example: eax). Run the scan, look for values that are consistently the same for the player, while consistently different for everything else (comparing enemies vs player it could be a convenient 1 for player, 0 for enemies or vice versa). Pick the offset which you feel is right (it might not always be what it is right now, so you'd be better off picking a bunch for future). Then in the code you can simply do something like
Code:
cmp [eax+3C],0 // for example +3C is always 0 for player, and not 0 for enemies
je hookplayer

hookplayer:
  mov [playerBaseAddress],eax
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