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 


Unsure how to copy value [sym1]+off1 to [sym2]+off2 asm

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

Joined: 11 Jan 2016
Posts: 42

PostPosted: Wed Jul 12, 2017 7:52 pm    Post subject: Unsure how to copy value [sym1]+off1 to [sym2]+off2 asm Reply with quote

Can you guys help with my 1st-person view hack for Chronos? It's 64-bit. Meaning 8-byte addresses.

I used the AOB template to make the following symbols in two scripts:
_player
_camera

The addresses look like this (8 bytes allocated globalalloc(symbol,8 )):
[_player]+120 points to D716FAD0 with value -3109.79126 (X coord)
[_camera]+120 points to 11CB8D380 with value -4621.333496 (X coord)

Notice [_camera] has a 9-digit address. I want player coords continuously copied to the camera in a third script I'll call "First-person view." For the above instance, I want [_camera]+120 to be -3109.79126. How can I make that happen? I (cluelessly) tried the following asm:
Code:

...
  push ecx
  push edx
  mov ecx,[_player]
  add ecx,120
  mov edx,[_camera]
  add edx,120
  mov edx,[ecx]
  pop ecx
  pop edx
...

_________________
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 119

Joined: 09 Jun 2013
Posts: 3235

PostPosted: Wed Jul 12, 2017 8:59 pm    Post subject: Reply with quote

Code:
push rcx
push rdx
mov rcx,_player
mov rcx,[rcx]
mov edx,[rcx+120]
mov rcx,_camera
mov rcx,[rcx]
mov [rcx+120],edx
pop rdx
pop rcx
Back to top
View user's profile Send private message
idk31
Cheater
Reputation: 1

Joined: 11 Jan 2016
Posts: 42

PostPosted: Wed Jul 12, 2017 11:10 pm    Post subject: Reply with quote

Worked, of course. Thanks a lot Zanzer! What about adding 100 to the floating point value at Z, [_camera]+128? It puts the camera on the floor. EDIT: I found Darkbyte's answer in another post

EDIT2: The final product: Chronos freecam(+cheats)

_________________
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