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 


Add value of an address as offset for another address

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Pointer tutorials
View previous topic :: View next topic  
Author Message
painpenguiin
How do I cheat?
Reputation: 0

Joined: 17 Sep 2023
Posts: 3

PostPosted: Sun Sep 17, 2023 5:52 pm    Post subject: Add value of an address as offset for another address Reply with quote

Hi,

Quite new to this and have googled this and can't find a solution. (could be using the wrong search terms and I could just be totally stupid with the answer in my face..)

what I am trying to do is

(address 1) + (value of address 2) = address 3

address 1 being my base address

address 2's value being an offset that changes.

both address 1 and address 2 are static and known.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4307

PostPosted: Mon Sep 18, 2023 1:05 am    Post subject: Reply with quote

Code:
local addr1 = getAddress'game.exe+1234'
local val = readInteger'game.exe+5678'

local addr3 = addr1 + val

If you're talking about the address list, CE accepts Lua code in the provided fields. What's accepted is oddly lenient, so play around with it a little.
e.g. could use `game.exe+1234+readInteger'game.exe+5678'` in the "address" field, or use `readInteger'game.exe+5678'` as an offset.
There might be a better way of doing this.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25298
Location: The netherlands

PostPosted: Mon Sep 18, 2023 2:01 am    Post subject: Reply with quote

you can use the [ ] with the ( ) notation for that

e.g memoryrecord with description "address 2" has an address with the value 1000
memoryrecord with description "address 1" has address 00400000
you can then give as address for address 3:
Code:

(address 1)+[(address 2)]

and the address will be 00401000, and updates every 10 seconds when address 2's value changes.

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
painpenguiin
How do I cheat?
Reputation: 0

Joined: 17 Sep 2023
Posts: 3

PostPosted: Mon Sep 18, 2023 6:35 am    Post subject: Reply with quote

Thanks so much both of you!. i was fiddling around for so long trying to figure it out.
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 Tutorials -> Pointer tutorials 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