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 


How do I store an address from two registers

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

Joined: 08 Feb 2021
Posts: 32

PostPosted: Tue Aug 10, 2021 12:42 pm    Post subject: How do I store an address from two registers Reply with quote

Hi guys, I seem to have hit an issue where my brain no longer seems to be working. I can't for the life of me remember how to get the resulting address from combining two registers. For example, I have a compare:
Code:
comiss xmm7,[rcx+rbx+70]

I am trying to get the address of just [rcx+rbx]. I setup a symbol basePTR and tried doing:
Code:
push eax
mov eax, [rcx+rbx]
mov [basePTR], eax
pop eax

But this doesn't seem to be working. I know it's probably quite simple but I just can't seem to figure it out.
Back to top
View user's profile Send private message
DanyDollaro
Master Cheater
Reputation: 3

Joined: 01 Aug 2019
Posts: 334

PostPosted: Tue Aug 10, 2021 2:09 pm    Post subject: Reply with quote

Code:
mov eax, [rcx+rbx]

EAX is a 32-bit register, RCX and RBX are 64-bit registers.

This should work for you:
Code:
push rax
lea rax, [rcx+rbx] // Notice this is a lea, not a mov
mov [basePTR], rax
pop rax


EDIT, you can also do:
Code:
lea rax, [rcx+rbx+70]
Back to top
View user's profile Send private message
Kajih
Cheater
Reputation: 1

Joined: 08 Feb 2021
Posts: 32

PostPosted: Tue Aug 10, 2021 2:51 pm    Post subject: Reply with quote

oh for f**k sakes... I honestly can't believe I actually missed that. I swear, I do know basic assembly! Embarassed lol
Back to top
View user's profile Send private message
devAnd
Newbie cheater
Reputation: 0

Joined: 22 Jun 2020
Posts: 13
Location: C#, java and ASM

PostPosted: Tue Aug 10, 2021 10:43 pm    Post subject: Reply with quote

Kajih wrote:
oh for f**k sakes... I honestly can't believe I actually missed that. I swear, I do know basic assembly! Embarassed lol


hahaha it happens bro.
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