| View previous topic :: View next topic |
| Author |
Message |
Zephiles Advanced Cheater
Reputation: 0
Joined: 04 Feb 2016 Posts: 56
|
Posted: Thu Aug 04, 2016 12:31 pm Post subject: Need Pointer Help |
|
|
| I am working with an address of 81020C00. The value at this address is always used as a pointer, and the value is dynamic. What I want to do is create a pointer, using the value at 81020C00 as the address, as well as adding an offset to this. Can this be done? And if it can be done, can someone explain the steps to doing so?
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Aug 04, 2016 12:53 pm Post subject: |
|
|
| Add a new entry. Enable the Pointer checkbox. Insert 81020C00 as the bottom value.
|
|
| Back to top |
|
 |
Zephiles Advanced Cheater
Reputation: 0
Joined: 04 Feb 2016 Posts: 56
|
Posted: Thu Aug 04, 2016 1:15 pm Post subject: |
|
|
| Doing that gives me a value of A000038120110381, when it's supposed to be 81031120.
|
|
| Back to top |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Thu Aug 04, 2016 1:26 pm Post subject: |
|
|
With the information you gave us, Zanzer is correct.
Last edited by cooleko on Thu Aug 04, 2016 3:06 pm; edited 1 time in total |
|
| Back to top |
|
 |
Zephiles Advanced Cheater
Reputation: 0
Joined: 04 Feb 2016 Posts: 56
|
Posted: Thu Aug 04, 2016 1:37 pm Post subject: |
|
|
I'm pretty sure I didn't make an error.
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Aug 04, 2016 1:41 pm Post subject: |
|
|
Based on your screenshot, what is the value you're expecting to be at that address?
Is the value stored in big endian format too? Don't think CE can help you there.
It appears to be a 64-bit program... is the value you want 64-bit too?
|
|
| Back to top |
|
 |
Zephiles Advanced Cheater
Reputation: 0
Joined: 04 Feb 2016 Posts: 56
|
Posted: Thu Aug 04, 2016 1:44 pm Post subject: |
|
|
The value that I'm expecting is 81031120, which is in Big Endian format.
The program is a 64 bit program, but the value itself should be a 32 bit one.
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Aug 04, 2016 1:58 pm Post subject: |
|
|
That's two strikes against you as far as CE is concerned.
Could achieve the desired result using Lua probably.
|
|
| Back to top |
|
 |
Zephiles Advanced Cheater
Reputation: 0
Joined: 04 Feb 2016 Posts: 56
|
Posted: Thu Aug 04, 2016 2:00 pm Post subject: |
|
|
| Well unfortunately I'm not familiar with Lua, so i wouldn't know how to do that.
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Aug 04, 2016 2:03 pm Post subject: |
|
|
Does this get you half way there? The value is just little endian. Add an address of "myvar" to the table.
| Code: | [ENABLE]
label(myvar)
{$lua}
return string.format("%X", readInteger(0x81020C00))..":"
{$asm}
myvar:
registersymbol(myvar)
[DISABLE]
unregistersymbol(myvar) |
|
|
| Back to top |
|
 |
Zephiles Advanced Cheater
Reputation: 0
Joined: 04 Feb 2016 Posts: 56
|
Posted: Thu Aug 04, 2016 2:14 pm Post subject: |
|
|
| Do I just add that as a Lua script? Because doing that is giving me errors.
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Aug 04, 2016 2:19 pm Post subject: |
|
|
Memory Viewer: Tools > Auto Assemble | Paste | File > Assign to current cheat table
| Code: | [ENABLE]
label(myvar)
{$lua}
local address = readInteger(0x81020C00)
address = string.format("%X", address)
local reverse = ""
for byte in string.gmatch(address, "..") do
reverse = byte .. reverse
end
return reverse .. ":"
{$asm}
myvar:
registersymbol(myvar)
[DISABLE]
unregistersymbol(myvar) |
|
|
| Back to top |
|
 |
Zephiles Advanced Cheater
Reputation: 0
Joined: 04 Feb 2016 Posts: 56
|
Posted: Thu Aug 04, 2016 2:24 pm Post subject: |
|
|
| Alright this works, but it only updates the value whenever I execute it. Is there a way to make it update constantly, or whenever the value changes?
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Aug 04, 2016 2:30 pm Post subject: |
|
|
| Code: | {$lua}
[ENABLE]
if mytimer == nil then
mytimer = createTimer(nil, false)
end
mytimer.Interval = 1000
mytimer.OnTimer = function(timer)
local address = readInteger(0x81020C00)
if address ~= old_address then
old_address = address
address = string.format("%X", address)
local reverse = ""
for byte in string.gmatch(address, "..") do
reverse = byte .. reverse
end
unregisterSymbol("myvar")
registerSymbol("myvar", tonumber(reverse, 16))
end
end
mytimer.Enabled = true
[DISABLE]
mytimer.Enabled = false |
|
|
| Back to top |
|
 |
Zephiles Advanced Cheater
Reputation: 0
Joined: 04 Feb 2016 Posts: 56
|
Posted: Thu Aug 04, 2016 2:39 pm Post subject: |
|
|
OK this works, but there's a couple issues.
1: When I close the game, I get an error message saying: Error:[string "local syntaxcheck=...
..."]:10: bad argument #2 to 'format' (number expected, got nil)
2. When I reboot the game after this, I get another error saying: Error:You can't add a symbol with address 0
Last edited by Zephiles on Thu Aug 04, 2016 3:06 pm; edited 1 time in total |
|
| Back to top |
|
 |
|