Hello and welcome to your new session.
In this session, we are going to study bitwise logical operations.
So first, we will discuss the theory behind it and see how it works.
So we have the bitwise AND operation.
Assuming that in the -, - has got the values all these values, and - has got all these values.
So the result of zero and zero will be zero.
So that is an AND operation for zero and zero.
Then the result of zero and one is zero.
The result of one and zero is zero. One and one gives you one.
So in order to get one, both - and - must be one.
Let's take a look at an example.
Supposing the first binary number is this and second binary number is this.
So what is the result of AND?
If you go from top to bottom and compare each bit, bit by bit, you will see that zero and one is zero,
zero and one is zero,
zero and one is zero, zero and zero is zero, zero and zero is zero, one and one is one, zero and one is zero, zero and zero is zero.
So the final result of performing an AND operation between this value and this value gives you this result.
Take a look at the next one, bitwise OR operation.
So in bitwise OR operation, zero or zero is zero, zero or one is one, one or zero is one, one or one is one.
So the idea here is either - is one or - is one.
The result will be one.
Take an example.
If your first binary number is this and the second binary number is this,
so if we did the OR operation for every bit, one or zero is one, zero or one is one, one or zero is one, one or zero is
one, one or zero is one, one or one is one, zero or zero is zero, zero or zero is zero.
So you read the final result is this.
Next one is a bitwise XOR operation.
XOR operation requires that only one of these be one.
You cannot have both be one.
Take a look at this. Zero XOR zero is zero, zero XOR one is one, one XOR zero is one, one XOR one is zero.
So you can see here this one does not fulfill the requirement.
So that's why you're getting zero.
Take a look at example.
If first number is this, second number is this.
If you perform a XOR, one XOR zero is one, zero XOR one is one, one XOR zero is one, one XOR zero is one, one XOR zero is one, one XOR one is zero, zero XOR zero is zero, zero XOR zero is zero.
And the last one is bitwise NOT operation.
So what it does is just to reverse the value.
So NOT zero is one, NOT one is zero.
So an example will be this.
If you are going to NOT two values,
so you compare the first number here.
If you are going to NOT this value, you take the first bit here.
If you NOT one, it becomes zero.
NOT zero is one.
NOT one is zero, NOT one is zero, NOT zero is one, NOT one is zero,
NOT zero is one, NOT one is zero.
So finally what you get is all the bits are flipped.
So this is how the bitwise logical operations work. In the upcoming videos,
we are going to try this in the x64dbg.
That's all for this video.
Thank you for watching.