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 compare a value that is about to be written ?

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

Joined: 07 Nov 2010
Posts: 600

PostPosted: Fri Feb 17, 2012 10:28 am    Post subject: How to compare a value that is about to be written ? Reply with quote

eax is the address of my value that should never be 1 but that can be every other value that ebx writes in it
Code:
lea eax,[my pointer address]
lea ebx,[whatever address]
// and now i have to compare the value of the address in ebx with 1   how do i do that ?
cmp 1,[ebx] //?? is that correct ?
je donothing // if the value of the address held by ebx is equal to 1 then jump to code that does nothing else do not jump
originalcode:
// original code
jmp after code ... //return
donothing:
nop // code that does nothing
jmp after code ... //return

how to use cmp ?

_________________
... Fresco
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Fri Feb 17, 2012 4:37 pm    Post subject: Reply with quote

it's cmp [ebx],1

alternatively:
mov ebx,[whatever address]
cmp ebx,1

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Sat Feb 18, 2012 6:40 am    Post subject: Reply with quote

Thank you, I got it

in other words if eax = 000ABC00

eax <- without [ ] means use "000ABC00" like a number (703488 {dec})

if address "000ABC00" = FF (value) 255 {dec}

[eax] <- with [ ] means use the value stored in address "000ABC00" and [eax] would be FF {255}

Isn't that correct ?

_________________
... Fresco
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Sun Feb 19, 2012 12:18 pm    Post subject: Reply with quote

yes. A register like eax is just a value. If you want to read an address use [value]

so you can do either [00401234] or [eax] or even [eax+1234] to read the contents of that address that the value represents

also, since you seem to be limiting yourself to 255, I assume you want to work with bytes specifically

then use the "byte ptr [address]" notation

e.g:
cmp byte ptr [ebx],1

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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