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 


Cannot get address from symbol name

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
tdr2012
Cheater
Reputation: 0

Joined: 02 Nov 2014
Posts: 26

PostPosted: Sat Nov 07, 2015 1:11 pm    Post subject: Cannot get address from symbol name Reply with quote

Code:
   
shared=allocateSharedMemory("shared",  500)

registerSymbol("shared", shared)

getAddress("shared", true)


Whenever I use the method getAddress("shared", true), it returns this error message: Error:Failure determining what shared means

What I am trying to do is just read the address in which the string symbol "shared" contains. This should work, shouldn't it? Or am I missing something?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Nov 07, 2015 1:32 pm    Post subject: Reply with quote

Are you sure you're not really looking for this?
Code:
autoAssemble("globalalloc(shared,500)")
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4656

PostPosted: Sat Nov 07, 2015 1:33 pm    Post subject: Reply with quote

Leave off the true parameter on that getAddress(...) function, or just use false (the default value).

If you have that parameter set to true, then it tries to find the local symbols and module names in CE itself. From main.lua:
Quote:
getAddress(string, local OPTIONAL): ...set Local to true if you wish to querry the symboltable of the ce process
...
allocateSharedMemory(name, size): ...It then maps this shared memory block into the currently targeted process.

_________________
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
tdr2012
Cheater
Reputation: 0

Joined: 02 Nov 2014
Posts: 26

PostPosted: Sat Nov 07, 2015 1:53 pm    Post subject: Reply with quote

Zanzer wrote:
Are you sure you're not really looking for this?
Code:
autoAssemble("globalalloc(shared,500)")

Wow, yes, this is how I should have done it in the first place. Now, its correctly getting the address without error.

But, now, when I get the address and print out the address using:
Code:

autoAssemble([[globalalloc(shared,2000)]])
print(getAddress("shared"))


It prints out an address of 122880000, instead of the correct address 07530000 that the symbol "shared" holds.

Is there a way that this can be a 1:1 match? Do I need to parse 122880000 into a certain way?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4656

PostPosted: Sat Nov 07, 2015 2:00 pm    Post subject: Reply with quote

Code:
print(string.format("%X",getAddress("shared")))

_________________
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
tdr2012
Cheater
Reputation: 0

Joined: 02 Nov 2014
Posts: 26

PostPosted: Sat Nov 07, 2015 2:21 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Leave off the true parameter on that getAddress(...) function, or just use false (the default value).

If you have that parameter set to true, then it tries to find the local symbols and module names in CE itself. From main.lua:
Quote:
getAddress(string, local OPTIONAL): ...set Local to true if you wish to querry the symboltable of the ce process
...
allocateSharedMemory(name, size): ...It then maps this shared memory block into the currently targeted process.


Ah. Yes, I was a bit confused about this when I was reading it over. Thanks for making it clear for me.

ParkourPenguin wrote:
Code:
print(string.format("%X",getAddress("shared")))


Thanks a lot for this. It's now matching 1:1.
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
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