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 


offest too large, I want to use 'mov rax,[localplayer]'

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Emya
Newbie cheater
Reputation: 0

Joined: 28 Jul 2024
Posts: 14

PostPosted: Sun Jul 28, 2024 4:25 am    Post subject: offest too large, I want to use 'mov rax,[localplayer]' Reply with quote

In a thread I created, I want to use 'mov rax, [localplayer]' but it shows an 'offset too large' error. What should I do?

'mov rax, [localplayer]' shows an 'offset too large' error and fails to compile, while 'mov rax, localplayer' followed by 'mov rax, [rax]' does compile but doesn't give the desired result. What should I do? [localplayer] is an 8-byte pointer.

no wayyyyyyyyyyyyyyyyyyy
Back to top
View user's profile Send private message Send e-mail
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sun Jul 28, 2024 11:11 am    Post subject: Reply with quote

Code:
mov rax,[far_away_address]
Works fine for me. CE correctly assembles an `A1` MOV opcode. Maybe you're using a very old version of CE (update to the latest version), or you're not using rax (the A1 MOV opcode only works for the rax register).

For other registers:
Code:
mov rcx,localplayer
mov rcx,[rcx]
If this doesn't work, then `mov rcx,[localplayer]` wouldn't work either even if `localplayer` was near that instruction (i.e. offset isn't too large).
Perhaps you mean to dereference it again?
Code:
mov rcx,localplayer
mov rcx,[rcx]
mov rcx,[rcx]

_________________
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
Emya
Newbie cheater
Reputation: 0

Joined: 28 Jul 2024
Posts: 14

PostPosted: Sun Jul 28, 2024 1:05 pm    Post subject: thanks!!!!!!!!!!!!!!!!!! Reply with quote

ParkourPenguin wrote:
Code:
mov rax,[far_away_address]
Works fine for me. CE correctly assembles an `A1` MOV opcode. Maybe you're using a very old version of CE (update to the latest version), or you're not using rax (the A1 MOV opcode only works for the rax register).

For other registers:
Code:
mov rcx,localplayer
mov rcx,[rcx]
If this doesn't work, then `mov rcx,[localplayer]` wouldn't work either even if `localplayer` was near that instruction (i.e. offset isn't too large).
Perhaps you mean to dereference it again?
Code:
mov rcx,localplayer
mov rcx,[rcx]
mov rcx,[rcx]


I saw an input box and wasn't sure why your original text was there. I was worried that modifying it would make your response disappear, so I kept it as it was.

love you, bro. Should I do it this way? If this fails, should I try using 'mov rsi, [rsi]' twice?

push rax
mov rax,[localplayer]
mov rsi,rax
pop rax

or

mov rsi,localplayer
mov rsi,[rsi]
mov rsi,[rsi]

?

(It's my first time in this community, and I'm not sure about the etiquette here. I don't know how to properly thank you after receiving help, so I'll just share my plan for what to do next. In any case, bro, you might have helped me a lot.)



偏移过大求助.png
 Description:
 Filesize:  52.16 KB
 Viewed:  1807 Time(s)

偏移过大求助.png


Back to top
View user's profile Send private message Send e-mail
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sun Jul 28, 2024 1:32 pm    Post subject: Reply with quote

I don't know whether you need to use `mov rsi, [rsi]` once or twice. That depends on what value is written to [localplayer].

Use breakpoints to debug your code. Set a breakpoint at `mov rsi,localplayer` and step through the code.

_________________
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
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