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 


Quick question about compares

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
vng21092
Grandmaster Cheater
Reputation: 15

Joined: 05 Apr 2013
Posts: 644

PostPosted: Sun Oct 19, 2014 3:00 pm    Post subject: Quick question about compares Reply with quote

Whats the ASM equivalent of
(if(something) && if(something)){}
Back to top
View user's profile Send private message
hesho28
Newbie cheater
Reputation: 0

Joined: 03 Oct 2009
Posts: 13

PostPosted: Sun Oct 19, 2014 3:17 pm    Post subject: Reply with quote

CMP (compare) instruction and jmp (jump) instructions

for example if you are comparing values of eax and ebx


Code:
cmp eax,ebx
je Found // jump if equal to the code named found [which is a message box]

jmp @F

Found:

push 0
push offset MsgT
push offset MsgT
push 0
Call MessageBoxA
@@:
ret


there is alot of jumps like :
je (jump if equal)
jne (jump if not equal)
jge (jump if greater than or equal)

and alot more , just learn about these two instructions.

_________________
sssssss
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
vng21092
Grandmaster Cheater
Reputation: 15

Joined: 05 Apr 2013
Posts: 644

PostPosted: Sun Oct 19, 2014 3:21 pm    Post subject: Reply with quote

your missing my question, I need to compare the end results of two comparisons and make a jump off that.. you know... like
1&1=1
1&0=0
Back to top
View user's profile Send private message
hesho28
Newbie cheater
Reputation: 0

Joined: 03 Oct 2009
Posts: 13

PostPosted: Sun Oct 19, 2014 3:29 pm    Post subject: Reply with quote

vng21092 wrote:
your missing my question, I need to compare the end results of two comparisons and make a jump off that.. you know... like
1&1=1
1&0=0



You missing the point , with these instructions you can compare easily.

You mean you do want to make 2 comparisons for example

if this number greater than 1 and less than 4 (2 compares ) then do something

Watch this: [A Loop to check the two conditions]
// if al = 10

Code:
Loop:
Cmp al,1
jl NotFound // jump if less than
Cmp al,4
jg NotFound // jump if greater than

Found:
invoke MessageBox,0,offset MsgT,offset MsgT,MB_OK

jmp @f
NotFound:
dec al
jmp Loop
@@:

ret


This code won't stop until [If al greater than 1 && if al less than 4]

_________________
sssssss
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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