﻿1
00:00:00,150 --> 00:00:01,410
‫Hello and welcome, everybody.

2
00:00:02,250 --> 00:00:05,580
‫There's a small bug with the bass points, reviews of processes.

3
00:00:06,360 --> 00:00:16,110
‫So essentially I just want us to go to blank and blank dot C and ignore that test program.

4
00:00:16,110 --> 00:00:17,720
‫I made that to find the bug.

5
00:00:17,740 --> 00:00:18,090
‫Great.

6
00:00:18,780 --> 00:00:19,980
‫So you guys won't have that.

7
00:00:20,670 --> 00:00:24,220
‫And here I just want you to go for instar equals zero.

8
00:00:24,660 --> 00:00:26,010
‫I below a million.

9
00:00:27,730 --> 00:00:33,220
‫I plus plus and we're just going to go here and we're going to make clean Bill LSH.

10
00:00:34,090 --> 00:00:35,980
‫And I want to show you what happens.

11
00:00:37,070 --> 00:00:38,350
‫OK, we're going to run that.

12
00:00:38,920 --> 00:00:43,810
‫You'll see ABC testing, ABC testing, and then you'll see no processes to switch to.

13
00:00:45,250 --> 00:00:47,140
‫So this is a nasty bug.

14
00:00:47,140 --> 00:00:48,130
‫What is happening?

15
00:00:48,580 --> 00:00:54,790
‫Essentially, our follow up is using the base pointer and the base point of value is corrupted.

16
00:00:55,510 --> 00:00:58,510
‫Now, where does the base point of value get corrupted?

17
00:00:58,540 --> 00:01:01,180
‫Well, if we go to task and test out, see?

18
00:01:02,350 --> 00:01:05,710
‫And here we'll see test, switch, test for term.

19
00:01:06,370 --> 00:01:09,490
‫The bug is in tax returns are good to test it, I assume.

20
00:01:10,090 --> 00:01:11,770
‫And you will see.

21
00:01:14,590 --> 00:01:22,300
‫Tax return, buy here now everything, and he is correct, except when we call the general-purpose registers.

22
00:01:22,750 --> 00:01:25,290
‫So in the general purpose registers, what do we do?

23
00:01:25,300 --> 00:01:30,850
‫We restore all of the registers back to the ones that were in the register structure that we passed

24
00:01:30,850 --> 00:01:31,990
‫this assembly function.

25
00:01:32,260 --> 00:01:33,350
‫That's perfect, correct?

26
00:01:33,370 --> 00:01:33,670
‫Right.

27
00:01:34,000 --> 00:01:34,870
‫We go through them all.

28
00:01:34,870 --> 00:01:39,160
‫We restore EDIR, CBP, FedEx, X, and so on.

29
00:01:39,610 --> 00:01:41,890
‫But look what we do here on line 62.

30
00:01:42,580 --> 00:01:47,260
‫We pop the base pointer that we saved because here we push the base pointer.

31
00:01:47,740 --> 00:01:53,260
‫Here we popped off the base pointer, overwriting the restored base pointer value.

32
00:01:53,680 --> 00:02:01,480
‫And that is what leads to that nasty bug where accessing the stack is done incorrectly.

33
00:02:02,110 --> 00:02:04,270
‫So how do we fix this?

34
00:02:05,580 --> 00:02:05,890
‫Wow.

35
00:02:06,150 --> 00:02:12,570
‫We get rid of the pop MBP and we change it to add E.S.P fall, which will basically restore the stack

36
00:02:12,570 --> 00:02:15,630
‫pointer back to where it should be, whether it's home addresses.

37
00:02:16,050 --> 00:02:19,440
‫But it will not pop into the base pointer.

38
00:02:20,220 --> 00:02:20,590
‫OK.

39
00:02:20,610 --> 00:02:25,890
‫And once you've done that, if we now go back to the terminal and we make may clean bill that I think

40
00:02:26,430 --> 00:02:29,220
‫we should see that bug is now resolved.

41
00:02:31,310 --> 00:02:33,920
‫And there we go, everything works as expected.

42
00:02:34,730 --> 00:02:40,190
‫Now, that boat took a long time to find it really was a needle in a haystack.

43
00:02:40,220 --> 00:02:42,890
‫You saw how how easy that mistake was.

44
00:02:42,890 --> 00:02:43,190
‫Right.

45
00:02:44,630 --> 00:02:51,020
‫But, you know, Colonel, development is all about solving problems and and building systems.

46
00:02:51,020 --> 00:02:56,000
‫And, you know, even Microsoft are releasing bug fixes every few months.

47
00:02:56,810 --> 00:02:58,460
‫Nobody's immune from this.

48
00:02:58,850 --> 00:03:02,390
‫So I appreciate your patience with some of these bug fixes.

49
00:03:02,840 --> 00:03:08,350
‫But I will always fix any bug that is found in my work.

50
00:03:08,360 --> 00:03:10,880
‫And I appreciate your patience.

51
00:03:11,540 --> 00:03:17,210
‫And yes, so very easy bug to fix was a very hard bug to find.

52
00:03:17,990 --> 00:03:19,280
‫OK, take care of everyone.

