|
Cheat Engine The Official Site of 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
|
Posted: Sun Apr 08, 2018 4:00 pm Post subject: How to use MOV command? |
|
|
Hi,
my first experience with CE so sorry about dumb questions
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 |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
|
Back to top |
|
|
Fuse00 How do I cheat? Reputation: 0
Joined: 03 Apr 2018 Posts: 5 Location: Russia
|
Posted: Mon Apr 09, 2018 2:20 am Post subject: |
|
|
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 |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Mon Apr 09, 2018 7:19 am Post subject: |
|
|
Code: |
addss xmm0,(float)5000 //this adds 5000 to the float value
movss [edi+04],xmm0 |
_________________
|
|
Back to top |
|
|
Fuse00 How do I cheat? Reputation: 0
Joined: 03 Apr 2018 Posts: 5 Location: Russia
|
Posted: Mon Apr 09, 2018 1:00 pm Post subject: |
|
|
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 |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Mon Apr 09, 2018 9:34 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|