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 


Check if value has changed in Autoassembler

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
bhfff
Newbie cheater
Reputation: 0

Joined: 19 Jan 2017
Posts: 12

PostPosted: Sat Oct 21, 2017 11:30 am    Post subject: Check if value has changed in Autoassembler Reply with quote

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
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 4

Joined: 01 Feb 2016
Posts: 581

PostPosted: Sat Oct 21, 2017 12:11 pm    Post subject: Reply with quote

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!
patched cheat engine tutorials
Back to top
View user's profile Send private message
bhfff
Newbie cheater
Reputation: 0

Joined: 19 Jan 2017
Posts: 12

PostPosted: Sat Oct 21, 2017 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 4

Joined: 01 Feb 2016
Posts: 581

PostPosted: Sat Oct 21, 2017 4:25 pm    Post subject: Reply with quote

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!
patched cheat engine tutorials
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