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 


Adding two registered symbols in a cheat table as an address
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
markheloking
Cheater
Reputation: 2

Joined: 21 Nov 2009
Posts: 35

PostPosted: Thu Jan 14, 2016 8:10 am    Post subject: Adding two registered symbols in a cheat table as an address Reply with quote

So the short version is: how to use a symbol as an offset for a pointer?

See screenshot attached.

How I asked the question initially:
Quote:

Quite a simple question, but I can't seem to be able to figure it out.

I have a few scripts that register some symbols and fills them with values. Result is simple:

Pointer (address of 0BD60038 aka my own code space) - value of 10210600
Offset (address of 0BD60040 aka my own code space) - value of 00000040

If I look at the address of those values in my cheat table, it just says "Pointer", the name that I gave the symbol in my script. All this works as expected.

I can do "[Pointer]+40" to get the value of 10210640 that I want. But since the offset might change in my script I'd like to do: "[Pointer]+[Offset]", but cheatengine is unable to solve this into an address. Other things I've tried (unsuccessfully):

[Pointer]+[Offset]
[[Pointer]+[Offset]]
[[Pointer]]+[[Offset]]
([Pointer]+[Offset])
([Pointer])+([Offset])
Pointer+Offset (this was solvable, but just gave me 0)

Can someone please explain how to do this without me needing to register yet another symbol in my scripts which is just the addition of two symbols that I already have registered?



Not possible.png
 Description:
 Filesize:  13.86 KB
 Viewed:  12756 Time(s)

Not possible.png




Last edited by markheloking on Thu Jan 14, 2016 9:48 am; edited 1 time in total
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Thu Jan 14, 2016 8:44 am    Post subject: Reply with quote

Instead of "[Pointer]+[Offset]" you could also write "[Pointer]+Offset+0"
Back to top
View user's profile Send private message
markheloking
Cheater
Reputation: 2

Joined: 21 Nov 2009
Posts: 35

PostPosted: Thu Jan 14, 2016 8:55 am    Post subject: Reply with quote

That indeed does work, but that validates as:

"[Pointer]+Offset+0"
meaning
Value that pointer points to (10210600, itself another pointer) + the address of the offset (0BD60040) + 0
aka
10210600 + 0BD60040 + 0 = 1BF70640

So that does not solve my problem since I need to add the value that is stored in the symbol "Offset", not the address of that symbol.
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Thu Jan 14, 2016 8:57 am    Post subject: Reply with quote

Could you probably provide a screenshot?
Back to top
View user's profile Send private message
markheloking
Cheater
Reputation: 2

Joined: 21 Nov 2009
Posts: 35

PostPosted: Thu Jan 14, 2016 8:59 am    Post subject: Reply with quote

At the moment I'm in the middle of figuring out a structs contents using that same table, so I'll screenshot in a minute.
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 Jan 14, 2016 9:01 am    Post subject: Reply with quote

With your instruction that sets the value of "offset", simply make it add "pointer" there as well.
Code:
mov [offset],eax
push eax
mov eax,[pointer]
add [offset],eax
pop eax
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Thu Jan 14, 2016 9:02 am    Post subject: Reply with quote

So you want to follow a pointer with assembler?
Back to top
View user's profile Send private message
markheloking
Cheater
Reputation: 2

Joined: 21 Nov 2009
Posts: 35

PostPosted: Thu Jan 14, 2016 9:07 am    Post subject: Reply with quote

Well not really. In a piece of assembly code I catch the pointer (because this changes a lot, and catching it this way is waaaay easier plus I don't think there is a toplevel pointer because of the way this game is build). I then put this pointer (in this case the 10210600) in a piece of allocated space, and give that a symbol name and register that symbol. This basically sets me up so that in my own allocated space (address 0BD60038, named Pointer by a registered symbol) the address of this pointer is stored (10210600).

I do all this because I want to show the value of 10210600+40 in my table.
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Thu Jan 14, 2016 9:13 am    Post subject: Reply with quote

So you want the read the pointer from my attached screenshot in assembler language, did I get that right?


01.png
 Description:
 Filesize:  3.93 KB
 Viewed:  12855 Time(s)

01.png


Back to top
View user's profile Send private message
markheloking
Cheater
Reputation: 2

Joined: 21 Nov 2009
Posts: 35

PostPosted: Thu Jan 14, 2016 9:40 am    Post subject: Reply with quote

See attached images.

If I use [Pointer]+Offset+0 it doesn't resolve btw, but if I use [Pointer]+Offset then it does.
I don't use the pointer screen from cheatengine, jus tthe "add address manually".

What I Get contains: [Pointer]+Offset
What I Want contains: [Pointer]+40 (manually entered the offset here so you see what it's supposed to produce as output in the table)



WhatIWant.png
 Description:
 Filesize:  12.51 KB
 Viewed:  12846 Time(s)

WhatIWant.png



WhatIGet.png
 Description:
 Filesize:  12.45 KB
 Viewed:  12846 Time(s)

WhatIGet.png



Table.png
 Description:
 Filesize:  1.27 KB
 Viewed:  12846 Time(s)

Table.png


Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Thu Jan 14, 2016 9:43 am    Post subject: Reply with quote

Well, you try to fill in a pointer into a single address. Click on the checkbos which reads "Pointer" and you're box will look like the one from my screenshot.

There you can fill in your Base in the big edit field below and the offset in the small (just as I did).
Back to top
View user's profile Send private message
markheloking
Cheater
Reputation: 2

Joined: 21 Nov 2009
Posts: 35

PostPosted: Thu Jan 14, 2016 9:43 am    Post subject: Reply with quote

If it doesn't resolve you just get to see this in the table.

Please note that the actual names for the pointer and offset are different (longer) but end in offset and pointer so you still get what I mean.

CharacterUnlockScreenBasePointer = Pointer
CurrentSelectedCharOffset = Offset

[EDIT]
So if I use the pointer screen as you said (which effectively does the same thing, but rather with a GUI), you see the problem: you can't use a symbol as an offset!
See screenshot attached



Not possible.png
 Description:
 Filesize:  13.86 KB
 Viewed:  12841 Time(s)

Not possible.png



Doesn't resolve.png
 Description:
 Filesize:  1.93 KB
 Viewed:  12848 Time(s)

Doesn't resolve.png


Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Thu Jan 14, 2016 10:02 am    Post subject: Reply with quote

Hm, then CE isn't capable of that ... But there's a workaround:

Code:
alloc(PTR,512)
label(invalid)
label(finalPointer)
registersymbol(finalPointer)

PTR:
pushad
//Follow Pointer
mov eax,[CharacterUnlockScreenBasePointer]
test eax,eax
jz invalid   //jump if invalid pointer
mov eax,[eax+CurrentSelectedCharOffset]
test eax,eax
jz invalid
mov [finalPointer],eax   //assign address to new symbol

invalid:
push #50   //50ms timeout
call sleep
popad
jmp PTR

finalPointer:
dd 00

createthread(PTR)


assign that code as a seperate script. It reads your pointerpath every 50 miliseconds and assigns the final address to a new symbol, which you can easily insert into the "Add address manually" field ...
Back to top
View user's profile Send private message
markheloking
Cheater
Reputation: 2

Joined: 21 Nov 2009
Posts: 35

PostPosted: Thu Jan 14, 2016 10:09 am    Post subject: Reply with quote

Hmmm... I'm going to steal that code for other purposes (the threading and such, haven't familiarized myself with that stuff yet). It's quite obsolete though as it's literally only 3 rows of extra code in my script (for now). I was just wondering if it was possible to work that magic with multiple offsets and such (especially if I'm trying to do something without scripts).

Thank you though.

@dark_byte why isn't it possible to use a symbol as offset or stuff like:

[Pointer]+Offset1+Offset2

Very often you have games and programs using multiple layers of offsets (linked lists or structs would come to mind).
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Thu Jan 14, 2016 10:09 am    Post subject: Reply with quote

Too bad I didn't read your topic yesterday.


My response would be: "just use another user symbol"

_________________
Back to top
View user's profile Send private message MSN Messenger
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, 3  Next
Page 1 of 3

 
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