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 to use MOV command?

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

Joined: 03 Apr 2018
Posts: 5
Location: Russia

PostPosted: Sun Apr 08, 2018 4:00 pm    Post subject: How to use MOV command? Reply with quote

Hi,

my first experience with CE so sorry about dumb questions Confused

I have an address and the value it stores is 0. I need to change this value to 1 or 1.5. I can't simply change and freeze it because the game constantly re-writes it back to the default one (0).

I found the inctruction which writes to this address. In case I replace this instruction with NOPs and change the value after that, it works fine (the game re-writes it no more).

But I actually want to make a script based on AOB injection in order to avoid entering the value manually.

That is how original code looks like:

Code:
  mov [rcx+00000098],eax   //this instruction writes to the adress I want to edit
  jmp return



This is how I tried to edit it:
Code:
  mov eax,1
  mov [rcx+00000098],eax
  jmp return


But it doesn't work. Nothing changes and value stays the same (0).

Please advice, what should I do?
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sun Apr 08, 2018 4:33 pm    Post subject: Re: How to use MOV command? Reply with quote

Fuse00 wrote:
...I need to change this value to 1 or 1.5.
...


Is it a float or an integer, your moving an int into EAX; and integers don't have fractional values. If it's a float then try "mov [rcx+98],(float)1".

See Value types

Fuse00 wrote:
...I can't simply change and freeze it because the game constantly re-writes it back to the default one (0).
...


Then you will need to change all code that writes to the value, use "see what writes to this address" to find out what's writing to it.

If you haven't done the CE tutorial then I would say start there.
http://wiki.cheatengine.org/index.php?title=Tutorials:Cheat_Engine_Tutorial_Guide_x32
http://wiki.cheatengine.org/index.php?title=Tutorials:Cheat_Engine_Tutorial_Guide_x64

_________________
Back to top
View user's profile Send private message Visit poster's website
Fuse00
How do I cheat?
Reputation: 0

Joined: 03 Apr 2018
Posts: 5
Location: Russia

PostPosted: Mon Apr 09, 2018 2:20 am    Post subject: Reply with quote

The value type is float (it is the camera position coordinate).

Thank you for the response, I will try it.

I have one more question in case you don't mind.
There is another way to achieve what I want (I want move camera on 1 point upper by Y axis and make stay this way).

There is a camera's Y coordinate in the worldspace, for example: XXX. In case I want camera to fly upper, I need to make it XXX+1. I tried to add to the camera value a few points by using this code written by mgr.inz.Player user, which he posted somewhere on this forum:

Code:
push eax
cvttss2si eax,xmm0
add eax,(int)5000 //this adds 5000 to the float value
cvttsi2ss xmm0,eax
pop eax
movss [edi+04],xmm0


It works, but it uses integer, and I need float. This code cuts every symbol after the dot, in other words 2555.1234 becomes just 2555, which is not ok, because this way camera moves jerky, not smoothly.

Maybe you know how to edit the code above in order to make add a float value?

P.S. Changing (int) to (float) brings no result.. this way the code doesn't work at all
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Mon Apr 09, 2018 7:19 am    Post subject: Reply with quote

Code:

addss xmm0,(float)5000 //this adds 5000 to the float value
movss [edi+04],xmm0

_________________
Back to top
View user's profile Send private message Visit poster's website
Fuse00
How do I cheat?
Reputation: 0

Joined: 03 Apr 2018
Posts: 5
Location: Russia

PostPosted: Mon Apr 09, 2018 1:00 pm    Post subject: Reply with quote

TheyCallMeTim13, thank you very much!

The first variant (mov [rcx+98],(float)1) works fine.

The second one doesn't compile this string - "addss xmm0,(float)5" for some reason, but that doesn't matter anymore.

Thank you.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Mon Apr 09, 2018 9:34 pm    Post subject: Reply with quote

Fuse00 wrote:
TheyCallMeTim13, thank you very much!

The first variant (mov [rcx+98],(float)1) works fine.

The second one doesn't compile this string - "addss xmm0,(float)5" for some reason, but that doesn't matter anymore.

Thank you.


I don't know what I was thinking, ADDSS won't take an immediate, you'll need to make an address to pass the value.
Code:

newmem:
// ...
addss xmm0,[addValue]
movss [edi+04],xmm0
// ...
jmp returnhere
label(addValue)
addValue:
  dd (float)5000
// ...

_________________
Back to top
View user's profile Send private message Visit poster's website
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