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 


[help] Putting a value of a pointer in eax

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
armanistar
How do I cheat?
Reputation: 0

Joined: 01 Jun 2022
Posts: 4

PostPosted: Wed Jun 01, 2022 8:02 am    Post subject: [help] Putting a value of a pointer in eax Reply with quote

Hi all,

Thanks for being here. After days of puzzling i cant figure out what goes wrong.

Current case:
mov eax, #0 // X Coords

This puts the value #0 into eax which is used as an X coord. This works.
But now i want it to listen to a different value, one not specified by me but by a pointer.


The pointer im talking about is:
[[0180C114+A34]+24]+68


Im trying to do it like this but this doesnt work:

mov eax,[0180C114]
mov eax,[eax+A34]
mov eax,[eax+24]
mov eax,[eax+68] // X



How can i get the value of that pointer and put it into eax?
Back to top
View user's profile Send private message
TsTg
Master Cheater
Reputation: 5

Joined: 12 Dec 2012
Posts: 340
Location: Somewhere....

PostPosted: Wed Jun 01, 2022 8:55 am    Post subject: Reply with quote

Code:

lea eax,[0180C114]
mov eax,[eax+A34]
mov eax,[eax+24]
mov eax,[eax+68]

that should do.
Back to top
View user's profile Send private message
armanistar
How do I cheat?
Reputation: 0

Joined: 01 Jun 2022
Posts: 4

PostPosted: Wed Jun 01, 2022 9:40 am    Post subject: Reply with quote

TsTg wrote:
Code:

lea eax,[0180C114]
mov eax,[eax+A34]
mov eax,[eax+24]
mov eax,[eax+68]

that should do.


I tried this out but it also crashes the application.

This is the full code i tried:



Code:

mov ecx,eax
mov eax,[esp+0C]

lea eax,[0180C114]
mov eax,[eax+68]
mov eax,[eax+24]
mov eax,[eax+A34]

mov [eax],eax // X

pop edi
mov [eax+04],#100 // Y
pop esi
ret 0004


imgur . com/RXAOIte . png





Update: I got it working when directly inputting the address where the pointer leads to. so the code was like this:

Code:
mov edx, [0D98370C]
mov [eax],edx// X


so i know that when i have the pointer working, it should work. But sadly i have no luck with the pointer yet.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4764

PostPosted: Wed Jun 01, 2022 11:02 am    Post subject: Reply with quote

edit for context: this was a response to a post TsTg removed
That's wrong- you're not dereferencing the first node, and the last offset isn't 0.
Code:
lea eax,[0180C114]  // same as `mov eax,0180C114`
mov eax,[eax+A34]
mov eax,[eax+24]
mov eax,[eax+68]    // eax is now the value of the pointer, not the address
// mov eax,[eax]    // this is not a pointer- it would likely crash the application

// this pointer path is basically [[[0180C114+A34]+24]+68]+0


Code:
mov eax,[game.exe+1234]
mov eax,[eax+A34]
mov eax,[eax+24]
lea eax,[eax+68]  // eax is now the address of the value you want
mov ecx,[eax]     // ecx is now the value at that address

If you're in 64-bit code, replace eax with rax.

Basically the code in the first post should've worked (unless it's 64-bit and not 32-bit). Post the full script (maybe the problem is somewhere else), and clarify what you mean by it "doesn't work": does the script fail to enable, or does it crash the process?

_________________
I don't know where I'm going, but I'll figure it out when I get there.


Last edited by ParkourPenguin on Wed Jun 01, 2022 12:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
armanistar
How do I cheat?
Reputation: 0

Joined: 01 Jun 2022
Posts: 4

PostPosted: Wed Jun 01, 2022 11:04 am    Post subject: Reply with quote

TsTg wrote:
you missed the image base basically, that picture you posted explains the crashing, also note that when writing pointer do never change the offsets order, the following should work:

\
Sadly it still crashes.

What i found out was that when using eax the game would crash with this code:

Code:
mov eax, [0D92D88C]
mov [eax],eax// X


But when running:
Code:
mov edx, [0D92D88C]
mov [eax],edx// X

it works.
So i also changed all what you said to edx as the working example here, and it still crashes Sad
Back to top
View user's profile Send private message
TsTg
Master Cheater
Reputation: 5

Joined: 12 Dec 2012
Posts: 340
Location: Somewhere....

PostPosted: Wed Jun 01, 2022 11:11 am    Post subject: Reply with quote

@Parkour Penguin totally my bad, writing super fast here xD
correct code:
Back to top
View user's profile Send private message
armanistar
How do I cheat?
Reputation: 0

Joined: 01 Jun 2022
Posts: 4

PostPosted: Wed Jun 01, 2022 11:13 am    Post subject: Reply with quote

ParkourPenguin wrote:
That's wrong- you're not dereferencing the first node, and the last offset isn't 0.
Code:
lea eax,[0180C114]  // same as `mov eax,0180C114`
mov eax,[eax+A34]
mov eax,[eax+24]
mov eax,[eax+68]    // eax is now the value of the pointer, not the address
// mov eax,[eax]    // this is not a pointer- it would likely crash the application

// this pointer path is basically [[[0180C114+A34]+24]+68]+0


Code:
mov eax,[game.exe+1234]
mov eax,[eax+A34]
mov eax,[eax+24]
lea eax,[eax+68]  // eax is now the address of the value you want
mov ecx,[eax]     // ecx is now the value at that address

If you're in 64-bit code, replace eax with rax.

Basically the code in the first post should've worked (unless it's 64-bit and not 32-bit). Post the full script (maybe the problem is somewhere else), and clarify what you mean by it "doesn't work": does the script fail to enable, or does it crash the process?




This is sooo awesome!
the script now succesfully gets the value Smile my cheat now starts to work bit by bit.

thanks for helping me understand my problem guys!
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