|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
bhfff Cheater Reputation: 0
Joined: 19 Jan 2017 Posts: 30
|
Posted: Sat Oct 21, 2017 11:30 am Post subject: Check if value has changed in Autoassembler |
|
|
There's a fixed value each time I enter the game, I want to edit it but only when it has changed.
How can I check if the value has changed using a script? (No lua if possible, I'm trying to learn assembly first)
|
|
Back to top |
|
|
OldCheatEngineUser Whateven rank Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Sat Oct 21, 2017 12:11 pm Post subject: |
|
|
just a quick reply, so put your value address where myuniquevalue is and what value you want to compare it to.
there might be better ways to do this, and there might be extra lines here.
you may wish to hook an instruction thats accessing the address, so it keep writing to it.
Code: | cmp [MyUniqueValue],0A // change this value
push edx
push eax
mov eax,0A // change this value
cmovne edx,eax
mov [MyUniqueValue],edx
pop eax
pop edx
|
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
|
bhfff Cheater Reputation: 0
Joined: 19 Jan 2017 Posts: 30
|
Posted: Sat Oct 21, 2017 12:30 pm Post subject: |
|
|
OldCheatEngineUser wrote: | just a quick reply, so put your value address where myuniquevalue is and what value you want to compare it to.
there might be better ways to do this, and there might be extra lines here.
you may wish to hook an instruction thats accessing the address, so it keep writing to it.
Code: | cmp [MyUniqueValue],0A // change this value
push edx
push eax
mov eax,0A // change this value
cmovne edx,eax
mov [MyUniqueValue],edx
pop eax
pop edx
|
|
Awesome! Thank you!
|
|
Back to top |
|
|
OldCheatEngineUser Whateven rank Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Sat Oct 21, 2017 4:25 pm Post subject: |
|
|
just a quick update, i wrote the script using my phone so i didnt pay enough attention to it.
you may dont want to enable the script when the value have not changed, because edx register wont be initialized and it will give you wrong result.
so its not recommended to use this method unless you enable it once the value is not what you wish, anyways here are two alternatives:
whats accesses the address method:
Code: | cmp [MyUniqueValue],0A // change this value
je code
mov [MyUniqueValue],0A
code:
// original instructions here |
whats writing to the address method:
Code: |
// patch it so it always move the number you want it to be
mov [to_this_location],0A
code:
// original instructions here |
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
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
|
|