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 


trouble in exposing address stored in register

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 82

PostPosted: Tue Dec 26, 2023 3:06 am    Post subject: trouble in exposing address stored in register Reply with quote

So I have this:

Code:

newmem:

sub rsp,20
movups [rsp],xmm0
movups [rsp+10],xmm1

movss xmm1,[rdi+280]
movss xmm0,[minH]
ucomiss xmm1,xmm0
jb code

cmp [rax+8],0
je code

mov [Playerbase],rdi
mov [PlayerRax],rax

code:
  movups xmm1,[rsp+10]
  movups xmm0,[rsp]
  add rsp,20

  mov ecx,[rax+08]
  mov [rbx+08],ecx
  jmp return


When I try to add
Code:
 [Playerbase]+280
as an address , it shows some different address. I think rdi is not getting exposed as Playerbase. But It shouldnot happen. Note that PlayerRax is the actual rax address.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Dec 26, 2023 1:36 pm    Post subject: Reply with quote

Did you look to see if the following code was storing the correct address:

Code:
mov [Playerbase],rdi


If not, I would check your filters.

If it is storing the correct address, then you can try [Playerbase+280] instead. If that doesn't work, try:

Code:
lea [Playerbase],rdi

I can only guess.
Back to top
View user's profile Send private message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 82

PostPosted: Tue Dec 26, 2023 1:43 pm    Post subject: Reply with quote

rdi+280 is the health of the player.

I tried setting rdi+280 to 0 just after assigning the value of rdi to Playerbase. The player gets killed immediately on each respawn. No problem. But the rdi is not the same when I access it outisde the cheat as I have registered the Playerbase symbol.


And I can't simply print the Playerbase or rdi in auto assembler script to verify. Even if there is a way I dont know that.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4652

PostPosted: Tue Dec 26, 2023 1:59 pm    Post subject: This post has 1 review(s) Reply with quote

I'd check the "pointer" checkbox, put "Playerbase" as the base address, and "280" as the only offset. Should be the same as what you're doing, but maybe CE updates it differently.

Set a breakpoint on `mov [Playerbase],rdi` and see what `rdi` is being written to it.

_________________
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
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 82

PostPosted: Tue Dec 26, 2023 2:02 pm    Post subject: Reply with quote

Oh yes, Forgot that we can set breakpoints also. Silly me.
Thank you both. Will check.
Back to top
View user's profile Send private message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 82

PostPosted: Wed Dec 27, 2023 12:38 am    Post subject: Reply with quote

Thanks everyone. I put the breakpoint at
Code:
mov [Playerbase],rdi
mov [PlayerRax],rax
. Found the issue.

It never happened with me before because I never played a game where addresses are also 8 bytes long. I have a habit of only allocating 4 bytes to a variable so the variable PlayerRax and Playerbase were allocated only 4 bytes at contiguous location. So that means if I put an 8 byte address to one of the variable, the next assignment to the other variable will overwrite the last 4 bytes of the first variable. And so the Playerbase here was getting overwritten by PlayerRax's value. So the first 4 bytes of the Playerbase was right just the last 4 bytes were completely unrelated.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4652

PostPosted: Wed Dec 27, 2023 11:14 am    Post subject: Reply with quote

Tip for future reference: when asking for help with a malfunctioning script, post the entire script. Don't just post the part you think is wrong.

Most experienced users could've pointed out that error in an instant had we seen the full script.

_________________
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
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 82

PostPosted: Wed Dec 27, 2023 11:27 am    Post subject: Reply with quote

Sorry sirs. I apologize for my ignorant behaviour.
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