View previous topic :: View next topic |
Author |
Message |
pzaw How do I cheat? Reputation: 0
Joined: 23 Dec 2015 Posts: 5
|
Posted: Sat Sep 14, 2019 7:05 pm Post subject: Pointer offset calculation based on value of another pointer |
|
|
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 |
|
|
Csimbi I post too much Reputation: 94
Joined: 14 Jul 2007 Posts: 3110
|
Posted: Sun Sep 15, 2019 6:10 am Post subject: |
|
|
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 |
|
|
pzaw How do I cheat? Reputation: 0
Joined: 23 Dec 2015 Posts: 5
|
Posted: Mon Sep 16, 2019 8:25 am Post subject: |
|
|
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.
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 |
|
|
Csimbi I post too much Reputation: 94
Joined: 14 Jul 2007 Posts: 3110
|
Posted: Mon Sep 16, 2019 12:13 pm Post subject: |
|
|
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
|
|
Back to top |
|
|
|