In this lesson we are going to look at how to set break points to pass on the strings firstly we will
learn how to set and remove the brake points how to run three break points and also understand what
arguments or parameters for cause.
So let's get started
if you were to run the Mexican trainee program from the command prompt.
It would display a string try harder and then it will create immediately let's try to run this using
the excessive for DB e.g.
we drive the correct me and drop it here to run
now the press at 9 to go to the entry point and this is the output.
The program has begun and passed at the entry point
in No.
Press F nine to run it will run so fast and quick so fast that you will be able to see this message.
Try had it as take a that is press 9
sorry f 9 is here and immediately the program executes and ten minutes so fast you won't be able to
see the string try harder.
So now how can we put a brake point so that the program would pass at the place where the string is
being displayed so that we can see in SC for the energy so let's restart click on the restart.
And now go to the entry point by pressing F nine
so before we can set a breakpoint to pass the story first we must look for the string.
Sometimes we can look for the three by searching in this column so we can scroll here.
Make sure you are at the entry point first.
Then you can scroll down.
And look for this three.
Try hard.
And there it is.
Try harder.
Excited for DV has helpfully interpreted this quote and should host the content so it is easy for us.
Now we know that this memory address here for this instruction somehow has this string starting day.
Try hard.
So we can put breakpoint here by double clicking and the breakpoint has been set.
As you can see the address has turned red.
So now we can run the code by pressing F nine.
And it will execute all the preceding instructions until he hits this instruction where it will pass
so let's go ahead and run it.
Now the code has passed but the string has not yet been output to the terminal
at this point.
The instruction here is move and so on so what it is doing is it is preparing the string preparing for
what it is preparing a string for the next instruction which is core print so every time there is a
call the preceding instructions must prepare the parameters or the arguments that will be used in the
call instruction.
The same thing up here all the instructions preceding the call are in preparation for the call because
the call will make use of all the instructions data up here you can as I mean every call before there's
a call you will have a set of instructions that prepare the data to be used by the call.
So the same thing happens here before this call happens the preceding instructions will prepare the
string try harder so that this call will be able to execute and show the string in the terminal so no
less press f it to move on.
So now we are at the con and we are about to execute it let's press f it again and see what happens
to the terminal window
as you can see the call has been executed and he has moved on and there is an output in the terminal
window.
Try harder so this is how we can use breakpoints to pass at strings so that we can see the output.
Now let me show you another way to find strings.
Let us remove this breakpoint first.
Sometimes we may not be so lucky as to be able to find strings in this column because a code could be
very very long and we could not be possible for us to keep scrolling scrolling scrolling to look for
strings.
Fortunately there is an easier way to look for strings.
So let us restart this program.
And no press F 9 to go to the entry point.
So we're now in the user mode you use a quote so to look for strings in this user mind you rightly scroll
down select search for current more you string references Harry repeat make sure you are in the user
mode you and then rightly scroll down search for current more you string references click the string
references and then you will open the tab string references perform the search in the user module ism
or you addresses as you will recall usually begins with 0 0 4 and so on and now it has found all the
strings in the user module and look one of it is try harder so we can now directly click on this address
to go to any length directly on the string that we are looking for and then we can go ahead and set
a break point here click Run so that he will you will run execute it stop at his breakpoint let's create
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
and you a the string has been printed to the terminal.
So this is the another way to look for strings and he's probably the easier way rather than to look
for strings by scrolling and scrolling
so the strings will be fun and distant and the references where you can actually see all of them sometimes
the list of strings may be very long and you could actually use to search in here to look for a string
in the result.
So if you wanted to loop for a string this result you can type try and you immediately will find the
result try harder.
So that is how we can search for strings and send break on the strings so thank you for watching.
I'll see you in the next one.
Meanwhile remember to remove the breakpoint.
Thank you.