1 00:00:01,050 --> 00:00:12,340 In this lesson we are going to look at how to set break points to pass on the strings firstly we will 2 00:00:12,340 --> 00:00:20,950 learn how to set and remove the brake points how to run three break points and also understand what 3 00:00:21,490 --> 00:00:25,600 arguments or parameters for cause. 4 00:00:25,660 --> 00:00:27,160 So let's get started 5 00:00:31,080 --> 00:00:37,380 if you were to run the Mexican trainee program from the command prompt. 6 00:00:40,960 --> 00:00:51,260 It would display a string try harder and then it will create immediately let's try to run this using 7 00:00:51,260 --> 00:00:53,670 the excessive for DB e.g. 8 00:00:57,480 --> 00:01:02,310 we drive the correct me and drop it here to run 9 00:01:06,720 --> 00:01:15,820 now the press at 9 to go to the entry point and this is the output. 10 00:01:15,830 --> 00:01:19,580 The program has begun and passed at the entry point 11 00:01:23,980 --> 00:01:25,580 in No. 12 00:01:25,630 --> 00:01:38,970 Press F nine to run it will run so fast and quick so fast that you will be able to see this message. 13 00:01:38,970 --> 00:01:43,640 Try had it as take a that is press 9 14 00:01:47,010 --> 00:01:58,320 sorry f 9 is here and immediately the program executes and ten minutes so fast you won't be able to 15 00:01:58,320 --> 00:02:01,760 see the string try harder. 16 00:02:02,460 --> 00:02:12,120 So now how can we put a brake point so that the program would pass at the place where the string is 17 00:02:12,120 --> 00:02:20,400 being displayed so that we can see in SC for the energy so let's restart click on the restart. 18 00:02:21,790 --> 00:02:26,700 And now go to the entry point by pressing F nine 19 00:02:31,020 --> 00:02:39,690 so before we can set a breakpoint to pass the story first we must look for the string. 20 00:02:39,690 --> 00:02:48,430 Sometimes we can look for the three by searching in this column so we can scroll here. 21 00:02:49,700 --> 00:02:51,880 Make sure you are at the entry point first. 22 00:02:52,950 --> 00:02:54,600 Then you can scroll down. 23 00:02:55,680 --> 00:02:57,490 And look for this three. 24 00:02:57,900 --> 00:02:58,590 Try hard. 25 00:03:02,700 --> 00:03:03,840 And there it is. 26 00:03:03,900 --> 00:03:05,430 Try harder. 27 00:03:05,530 --> 00:03:19,880 Excited for DV has helpfully interpreted this quote and should host the content so it is easy for us. 28 00:03:20,110 --> 00:03:28,260 Now we know that this memory address here for this instruction somehow has this string starting day. 29 00:03:28,630 --> 00:03:29,400 Try hard. 30 00:03:31,780 --> 00:03:38,660 So we can put breakpoint here by double clicking and the breakpoint has been set. 31 00:03:38,840 --> 00:03:42,080 As you can see the address has turned red. 32 00:03:43,250 --> 00:03:47,410 So now we can run the code by pressing F nine. 33 00:03:48,920 --> 00:04:00,080 And it will execute all the preceding instructions until he hits this instruction where it will pass 34 00:04:01,120 --> 00:04:03,730 so let's go ahead and run it. 35 00:04:06,430 --> 00:04:13,180 Now the code has passed but the string has not yet been output to the terminal 36 00:04:18,200 --> 00:04:19,010 at this point. 37 00:04:20,510 --> 00:04:29,870 The instruction here is move and so on so what it is doing is it is preparing the string preparing for 38 00:04:29,870 --> 00:04:42,610 what it is preparing a string for the next instruction which is core print so every time there is a 39 00:04:42,610 --> 00:04:53,170 call the preceding instructions must prepare the parameters or the arguments that will be used in the 40 00:04:53,170 --> 00:04:55,110 call instruction. 41 00:04:55,110 --> 00:05:05,110 The same thing up here all the instructions preceding the call are in preparation for the call because 42 00:05:05,110 --> 00:05:15,100 the call will make use of all the instructions data up here you can as I mean every call before there's 43 00:05:15,110 --> 00:05:23,580 a call you will have a set of instructions that prepare the data to be used by the call. 44 00:05:23,660 --> 00:05:31,040 So the same thing happens here before this call happens the preceding instructions will prepare the 45 00:05:31,040 --> 00:05:41,690 string try harder so that this call will be able to execute and show the string in the terminal so no 46 00:05:41,810 --> 00:05:45,180 less press f it to move on. 47 00:05:46,520 --> 00:05:54,920 So now we are at the con and we are about to execute it let's press f it again and see what happens 48 00:05:55,160 --> 00:05:56,480 to the terminal window 49 00:05:59,660 --> 00:06:09,740 as you can see the call has been executed and he has moved on and there is an output in the terminal 50 00:06:09,740 --> 00:06:10,550 window. 51 00:06:10,550 --> 00:06:23,430 Try harder so this is how we can use breakpoints to pass at strings so that we can see the output. 52 00:06:23,500 --> 00:06:27,880 Now let me show you another way to find strings. 53 00:06:28,130 --> 00:06:31,640 Let us remove this breakpoint first. 54 00:06:32,110 --> 00:06:40,960 Sometimes we may not be so lucky as to be able to find strings in this column because a code could be 55 00:06:40,960 --> 00:06:48,760 very very long and we could not be possible for us to keep scrolling scrolling scrolling to look for 56 00:06:48,760 --> 00:06:50,230 strings. 57 00:06:50,230 --> 00:06:54,600 Fortunately there is an easier way to look for strings. 58 00:06:54,910 --> 00:06:57,740 So let us restart this program. 59 00:06:59,550 --> 00:07:03,280 And no press F 9 to go to the entry point. 60 00:07:06,830 --> 00:07:19,140 So we're now in the user mode you use a quote so to look for strings in this user mind you rightly scroll 61 00:07:19,140 --> 00:07:31,720 down select search for current more you string references Harry repeat make sure you are in the user 62 00:07:31,720 --> 00:07:46,730 mode you and then rightly scroll down search for current more you string references click the string 63 00:07:46,730 --> 00:07:55,510 references and then you will open the tab string references perform the search in the user module ism 64 00:07:55,520 --> 00:08:05,310 or you addresses as you will recall usually begins with 0 0 4 and so on and now it has found all the 65 00:08:05,310 --> 00:08:15,620 strings in the user module and look one of it is try harder so we can now directly click on this address 66 00:08:16,490 --> 00:08:26,500 to go to any length directly on the string that we are looking for and then we can go ahead and set 67 00:08:26,770 --> 00:08:38,470 a break point here click Run so that he will you will run execute it stop at his breakpoint let's create 68 00:08:38,720 --> 00:08:51,500 F nine and he stops here and then f it f it again take a look at this I'll put you one more time effort 69 00:08:55,300 --> 00:08:59,860 and you a the string has been printed to the terminal. 70 00:09:00,680 --> 00:09:11,210 So this is the another way to look for strings and he's probably the easier way rather than to look 71 00:09:11,210 --> 00:09:14,420 for strings by scrolling and scrolling 72 00:09:17,870 --> 00:09:25,760 so the strings will be fun and distant and the references where you can actually see all of them sometimes 73 00:09:25,760 --> 00:09:33,140 the list of strings may be very long and you could actually use to search in here to look for a string 74 00:09:33,560 --> 00:09:35,690 in the result. 75 00:09:35,690 --> 00:09:43,490 So if you wanted to loop for a string this result you can type try and you immediately will find the 76 00:09:43,490 --> 00:09:45,930 result try harder. 77 00:09:46,430 --> 00:09:55,410 So that is how we can search for strings and send break on the strings so thank you for watching. 78 00:09:56,070 --> 00:09:57,200 I'll see you in the next one. 79 00:09:57,680 --> 00:10:00,320 Meanwhile remember to remove the breakpoint. 80 00:10:00,980 --> 00:10:01,360 Thank you.