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 


Why isn't this mov then cmp then jne NOT working?

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

Joined: 13 Aug 2018
Posts: 44

PostPosted: Sun Dec 29, 2019 7:00 pm    Post subject: Why isn't this mov then cmp then jne NOT working? Reply with quote

pushf
mov [142782E19],02
mov edx,00004060
@@:
mov [142782E19],02
cmp [142782E19],02
jne @b
popf
jmp exit


The idea here is that it seems very tricky to get the value of 2 to "stick" to the static address of 142782E19 and there is no rhyme or reason as to when it sticks and when it doesn't, so I have it applying twice AND came up with this compare loop to make sure the address of 142782E19 has accepted the value of 2 or it's SUPPOSED to jump back up and do it again, etc...

What's happening is:
1) Most of the time, the value of 2 never gets accepted by the 142782E19 address. There HAVE been times it has stuck but I can't figure out why.
2) When the compare checks to see if it has been changed to a 2, it acts like it was successful (even though it was not a value of 2) so it FAILS to jump back up and try to apply the 2 value again.

What's the explanation for why this is happening, and the correct way to write what I am trying to attempt here? (you can ignore the mov edx line)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4711

PostPosted: Sun Dec 29, 2019 9:43 pm    Post subject: This post has 1 review(s) Reply with quote

That is working; it's just that something else is writing to it that overwrites the value you wrote.
Set a breakpoint on your code and watch what happens.

Also, I'm pretty sure that's writing a 4-byte value. If you only want to write one byte:
Code:
mov byte ptr[142782E19],2

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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