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 


Need explication on test byte

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

Joined: 27 Sep 2018
Posts: 43

PostPosted: Wed May 22, 2019 3:12 am    Post subject: Need explication on test byte Reply with quote

Ok i've read a lot before posting but there is something i don't understand

the code is :
test byte ptr [ebp-00000158],06 (wasm code)
jne xxxxxxxx

on the screenshot in the red circle i have the byte value of ebp-00000158 <- ok ?


left side have 8h, right side 73h <- ok ?

so i do an AND logical test that set ZF to 1 if result is 0 ok ?
and i jump if ZF is not equal 0 (or is it not equal 1 ?)

8h = 0000 1000
6h = 0000 0110
so left test = 0 -> ZF = 1 -> jump must be done

73h= 0111 0011
6h = 0000 0110
so right test = 10 -> ZF = 0 -> jump is not done

but it's exactly the opposite that happen, what i miss understood ?

i assume if i change the test with 8h+6h = Eh as test value jump will be done in each case right ?

sorry if my english is not perfect.



ebp158.jpg
 Description:
 Filesize:  273.96 KB
 Viewed:  1047 Time(s)

ebp158.jpg


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed May 22, 2019 4:44 am    Post subject: Reply with quote

intel docs:
Code:

TEMP ← SRC1 AND SRC2;
IF TEMP = 0
THEN ZF ← 1;
ELSE ZF ← 0;
FI:


8 and 6 = 0
so ZF=1

Code:

JNE: Jump short if not equal (ZF=0).

so the jump will not be taken as ZF=1

You mistake is the working of JNE

_________________
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
Sanglante
Cheater
Reputation: 0

Joined: 27 Sep 2018
Posts: 43

PostPosted: Wed May 22, 2019 6:21 am    Post subject: Reply with quote

Thx Mastes DB !

so jne => jump if ZF not equal 1
Back to top
View user's profile Send private message
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