07-24-2023, 06:01 AM
Correct me if I am wrong.
This is my understanding of `JNZ` and `CMP`.
`JNZ` - The jump WILL take place if the `Z` Flag is NOT zero (1)
`CMP` - If the two values are equal, the `Z` Flag is set (1) otherwise it is not set (0)
![Olly DBG][1]
[1]:
This is a flash tutorial I am watching. It is teaching the solution to a simple CrackMe.
As you can see, the previous instruction compared `AL` with `47h`. They were equal which set the `Z` flag. (You can see it in the Registers windows on the right side)
The next instruction is a `JNZ`. My understanding was that the jump will take place if the `Z` flag is set. The `Z` flag IS set, but the jump doesn't take place!
Why?
This is my understanding of `JNZ` and `CMP`.
`JNZ` - The jump WILL take place if the `Z` Flag is NOT zero (1)
`CMP` - If the two values are equal, the `Z` Flag is set (1) otherwise it is not set (0)
![Olly DBG][1]
[1]:
This is a flash tutorial I am watching. It is teaching the solution to a simple CrackMe.
As you can see, the previous instruction compared `AL` with `47h`. They were equal which set the `Z` flag. (You can see it in the Registers windows on the right side)
The next instruction is a `JNZ`. My understanding was that the jump will take place if the `Z` flag is set. The `Z` flag IS set, but the jump doesn't take place!
Why?