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 


Get specific address from within aobs code!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Mon Jan 24, 2022 11:49 am    Post subject: Get specific address from within aobs code! Reply with quote

I'm a little confused.

I am using an aobs code to get the correct value.
And I'm trying to get the address of a specific value from within that code.
But I cannot move the current address to the address I want to receive.

Here is an example:

Search = "85 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?? ?? ?? ?? 06 00 00 00 06 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF E8 03 00 00 00 00 00 00"

result address: 09888E90

How can I get the address "E8 03 00 00"?
I want to take that address and add it as 4 bytes to the address list.

It's something I'm not very familiar with.
Thanks in advance for the help.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Mon Jan 24, 2022 1:45 pm    Post subject: This post has 1 review(s) Reply with quote

Add the difference, in bytes, as an offset to where you want the address to start. CE will return the starting address where the pattern is found, so then in your case, add +40 to the result to get to where E8 03 00 00 is at.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Mon Jan 24, 2022 2:18 pm    Post subject: Reply with quote

That should be 28 because 40 decimal in hex is 28.
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Mon Jan 24, 2022 2:28 pm    Post subject: Reply with quote

atom0s wrote:
Add the difference, in bytes, as an offset to where you want the address to start. CE will return the starting address where the pattern is found, so then in your case, add +40 to the result to get to where E8 03 00 00 is at.



Code:
tostring(aobs[0]) .. "+40"


Thanks for saving the day.
This was something I've wondered about for a long time.
+1 is yours when the time is up.
Thanks.
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