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 


Pointer offset calculation based on value of another pointer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
pzaw
How do I cheat?
Reputation: 0

Joined: 23 Dec 2015
Posts: 5

PostPosted: Sat Sep 14, 2019 7:05 pm    Post subject: Pointer offset calculation based on value of another pointer Reply with quote

Appreciate it if someone could please help.

I have in my table this:

Description........Address...............Type..........Value
Current............p->09D50B2C.......4 Bytes.......2 <---- Value of interest

(Sorry for the dots as I do not know how to do TABs to separate the text)

The pointer is made up of address and Offset as shown below:-

Pointer:
Address: 0069CCFC
Offset: 4

What I want to do is if I can:

Use this value (2 in this case) for Current Hero to calculate another pointer address like so:-

Address: 0069CCFC
Offset: [Current]*0A

ie Offset=Current X 0x0A

Is there a way to do this as above or in script perhaps?
I don't know where to start.

pzaw
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 94

Joined: 14 Jul 2007
Posts: 3110

PostPosted: Sun Sep 15, 2019 6:10 am    Post subject: Reply with quote

CE table entries cannot refer one another natively, but they do accept some degree of math.
Meaning, +0A works.
You need to test if multiplication works (I have not tried that, ever).
If I understood your needs correctly, this comes to mind (put this into address field)
0069CCFC+[0069CCFC]*0xA

Be vary of fixed addresses though.
You might be better off with a script that grabs the base into, say, pBase and use this in the address list instead:
[pBase]+[[pBase]]*0xA
Or, just do the math in the script itself and expose that directly.
Back to top
View user's profile Send private message
pzaw
How do I cheat?
Reputation: 0

Joined: 23 Dec 2015
Posts: 5

PostPosted: Mon Sep 16, 2019 8:25 am    Post subject: Reply with quote

Csimbi wrote:
CE table entries cannot refer one another natively, but they do accept some degree of math.
Meaning, +0A works.
You need to test if multiplication works (I have not tried that, ever).
If I understood your needs correctly, this comes to mind (put this into address field)
0069CCFC+[0069CCFC]*0xA


Multiplication works with numbers but will try your suggestion and see what happens.

thanks.

Edit: Just tried something and it seemed to work.

I have this:
Pointer:Hero
Address: 0069CCFC
Offset: 4

I wanted this:
Address: 0069CCFC
Offset: [Hero]*0A

so I tried using your idea and expand it to:

Pointer:
Address: 0069CCFC
Offset: [[0069CCFC]+4]*0A

and low and behold it worked!

Thanks for the idea. Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy
KUDOS to you man!

Now I have to double click in the address in order to refresh the value.
I expect it is because I am actually doing a double pointer by [[xxxxxx]+yy]

But still it is a whole lot better than before. Before this I had to manually edit the values. now with this I only need to manually refresh the value by double clicking on the address and click ok.

It works and I am a step closer to solving this.
Now I just have to write a script to refresh the table every sec or so.

Have any ideas?
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 94

Joined: 14 Jul 2007
Posts: 3110

PostPosted: Mon Sep 16, 2019 12:13 pm    Post subject: Reply with quote

Seems I missed that +4, but good to see you got it figured out.

I think you can do that refresh with a LUA thread or timer.
You need to ask in the LUA forum, I'm still more of an ASM guy Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions 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