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 


Set pointer address to a symbol

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

Joined: 27 Jul 2013
Posts: 121

PostPosted: Tue Jan 12, 2021 7:04 am    Post subject: Set pointer address to a symbol Reply with quote

Hi, i've tried, searched, finaly gave up and ask for your help, this should be simple enough but i just dont see it.
How can i set the address from a pointer into a symbol, so i can use the symbol as an address base afterwards?

This is what i tried:

Code:
[ENABLE]
registersymbol(VehicleMain)
alloc(VehicleMain,4)
//VehicleMain:
//[["somexe.exe"+027DEFD0]+0]+8C4
//mov [VehicleMain],[[["somexe.exe"+027DEFD0]+0]+8C4]
define(VehicleMain,[["somexe.exe"+027DEFD0]+0]+8C4)
[DISABLE]


My logic was that i would assign the pointer into the symbol, but it's not getting anything.

Thanks in advance.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4290

PostPosted: Tue Jan 12, 2021 12:43 pm    Post subject: Reply with quote

This should work:
Code:
[ENABLE]
define(VehicleMain,[["somexe.exe"+027DEFD0]+0]+8C4)
registersymbol(VehicleMain)
[DISABLE]
unregistersymbol(VehicleMain)

If it doesn't, this will, but note you'll have to dereference the symbol VehicleMain once to get at the actual pointed value:
Code:
[ENABLE]
alloc(VehicleMain,8)
registersymbol(VehicleMain)

VehicleMain:
{$lua}
return ("dq %08X"):format(syntaxcheck and 0 or getAddress'[["somexe.exe"+027DEFD0]+0]+8C4')
{$asm}


[DISABLE]
dealloc(VehicleMain)
unregistersymbol(VehicleMain)

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

Joined: 27 Jul 2013
Posts: 121

PostPosted: Tue Jan 12, 2021 2:10 pm    Post subject: Reply with quote

Hi, thank you for the reply.

I tested the code and for the first one, it returns something that doesn't make sense, an address like: 42211C723EB22E1E

The second code works, but im struggling to "adjust the address" like i would before, in asm like this:

Code:
sub [VehicleMain],8C4


Adding that bit to the code in asm section doesnt make anything.

So for my table purpose, i need to remove 8C4 from the resulting address, so that it sits nicely in the table.
Because i have so many entries, i think would be easier this way, instead of adjusting each entry in the table.

Aditionally, is it possible to run this in a loose loop, so that all the table entries that read VehicleMain, get updated automaticaly?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4290

PostPosted: Tue Jan 12, 2021 5:45 pm    Post subject: Reply with quote

The first one registers the symbol VehicleMain to be literally the address [["somexe.exe"+027DEFD0]+0]+8C4 - whatever that may be. You probably dereferenced it when you weren't suppose to.

careca777 wrote:
So for my table purpose, i need to remove 8C4 from the resulting address, so that it sits nicely in the table.
Remove the last offset or change it to 0. i.e. [["somexe.exe"+027DEFD0]+0]


From everything I've read so far, this might work better for you:
  1. Right click the address list, "Create Header", say yes when it asks you about an address
  2. Change the header's address: pointer, base address '"somexe.exe"+027DEFD0', 2 offsets both 0
  3. Add another address to the address list, address "+8C4", value type whatever
  4. Click and drag that new memory record onto the header

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

Joined: 27 Jul 2013
Posts: 121

PostPosted: Tue Jan 12, 2021 6:10 pm    Post subject: Reply with quote

Yes, thank you!
Back to top
View user's profile Send private message
careca777
Expert Cheater
Reputation: 0

Joined: 27 Jul 2013
Posts: 121

PostPosted: Wed Jan 13, 2021 6:02 pm    Post subject: Reply with quote

Hi again, i tried to place the code in a while loop, so it keeps refreshing, but it ends as if there was no loop, what would be the best approach?

Thanks in advance.
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 Gamehacking 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