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 


Need Pointer Help
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Thu Aug 04, 2016 12:31 pm    Post subject: Need Pointer Help Reply with quote

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
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Aug 04, 2016 12:53 pm    Post subject: Reply with quote

Add a new entry. Enable the Pointer checkbox. Insert 81020C00 as the bottom value.
Back to top
View user's profile Send private message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Thu Aug 04, 2016 1:15 pm    Post subject: Reply with quote

Doing that gives me a value of A000038120110381, when it's supposed to be 81031120.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Thu Aug 04, 2016 1:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Thu Aug 04, 2016 1:37 pm    Post subject: Reply with quote



I'm pretty sure I didn't make an error.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Aug 04, 2016 1:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Thu Aug 04, 2016 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Aug 04, 2016 1:58 pm    Post subject: Reply with quote

That's two strikes against you as far as CE is concerned. Smile
Could achieve the desired result using Lua probably.
Back to top
View user's profile Send private message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Thu Aug 04, 2016 2:00 pm    Post subject: Reply with quote

Well unfortunately I'm not familiar with Lua, so i wouldn't know how to do that.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Aug 04, 2016 2:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Thu Aug 04, 2016 2:14 pm    Post subject: Reply with quote

Do I just add that as a Lua script? Because doing that is giving me errors.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Aug 04, 2016 2:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Thu Aug 04, 2016 2:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Aug 04, 2016 2:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Thu Aug 04, 2016 2:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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