WEBVTT

1
00:00.740 --> 00:02.870
Hello and welcome to your new session.

2
00:02.870 --> 00:07.460
In this session, we are going to study bitwise logical operations.

3
00:07.940 --> 00:12.170
So first, we will discuss the theory behind it and see how it works.

4
00:12.620 --> 00:15.650
So we have the bitwise AND operation.

5
00:15.650 --> 00:23.090
Assuming that in the -, - has got the values all these values, and - has got all these values.

6
00:23.090 --> 00:26.360
So the result of zero and zero will be zero.

7
00:26.540 --> 00:29.810
So that is an AND operation for zero and zero.

8
00:30.020 --> 00:33.440
Then the result of zero and one is zero.

9
00:33.770 --> 00:37.640
The result of one and zero is zero. One and one gives you one.

10
00:37.940 --> 00:41.630
So in order to get one, both - and - must be one.

11
00:42.320 --> 00:43.940
Let's take a look at an example.

12
00:43.940 --> 00:47.930
Supposing the first binary number is this and second binary number is this.

13
00:47.930 --> 00:49.670
So what is the result of AND?

14
00:49.940 --> 00:57.800
If you go from top to bottom and compare each bit, bit by bit, you will see that zero and one is zero,

15
00:57.800 --> 00:59.360
zero and one is zero,

16
00:59.360 --> 01:07.700
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.

17
01:07.700 --> 01:14.990
So the final result of performing an AND operation between this value and this value gives you this result.

18
01:15.740 --> 01:18.380
Take a look at the next one, bitwise OR operation.

19
01:18.680 --> 01:28.220
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.

20
01:28.220 --> 01:32.810
So the idea here is either - is one or - is one.

21
01:32.810 --> 01:33.950
The result will be one.

22
01:34.460 --> 01:35.360
Take an example.

23
01:35.360 --> 01:39.380
If your first binary number is this and the second binary number is this,

24
01:39.380 --> 01:49.250
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

25
01:49.250 --> 01:55.580
one, one or zero is one, one or one is one, zero or zero is zero, zero or zero is zero.

26
01:55.580 --> 01:58.070
So you read the final result is this.

27
01:59.390 --> 02:03.410
Next one is a bitwise XOR operation.

28
02:03.410 --> 02:07.010
XOR operation requires that only one of these be one.

29
02:07.010 --> 02:08.180
You cannot have both be one.

30
02:08.510 --> 02:17.990
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.

31
02:17.990 --> 02:20.780
So you can see here this one does not fulfill the requirement.

32
02:20.960 --> 02:22.790
So that's why you're getting zero.

33
02:23.270 --> 02:24.290
Take a look at example.

34
02:24.290 --> 02:26.450
If first number is this, second number is this.

35
02:26.480 --> 02:41.990
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.

36
02:43.930 --> 02:47.350
And the last one is bitwise NOT operation.

37
02:47.410 --> 02:51.760
So what it does is just to reverse the value.

38
02:51.760 --> 02:57.190
So NOT zero is one, NOT one is zero.

39
02:57.460 --> 02:59.410
So an example will be this.

40
02:59.440 --> 03:02.050
If you are going to NOT two values,

41
03:02.260 --> 03:04.720
so you compare the first number here.

42
03:05.260 --> 03:08.590
If you are going to NOT this value, you take the first bit here.

43
03:08.590 --> 03:10.330
If you NOT one, it becomes zero.

44
03:10.360 --> 03:11.590
NOT zero is one.

45
03:11.590 --> 03:15.760
NOT one is zero, NOT one is zero, NOT zero is one, NOT one is zero,

46
03:15.760 --> 03:17.680
NOT zero is one, NOT one is zero.

47
03:17.680 --> 03:20.950
So finally what you get is all the bits are flipped.

48
03:21.280 --> 03:28.000
So this is how the bitwise logical operations work. In the upcoming videos,

49
03:28.000 --> 03:30.820
we are going to try this in the x64dbg.

50
03:31.210 --> 03:32.650
That's all for this video.

51
03:32.650 --> 03:34.060
Thank you for watching.