In this video, we'll be revisiting our last program, which we look at as an example.
So we'll be using this program, using out wraps and am already in my lap.
So let me just show you the source code of our fight again.
So much for frothier seat and this is our first call, we've seen that really, really right.
So you see, why do you say string Copi function, which copies the input of the program, which is
a compelling argument to a buffer cardioverter.
So the size of this buffer is, Tony, OK, so it can hold up to 20 characters so we can execute this.
OK, zero and defectors provide for a safe and effective end under the program will execute normally.
So what would happen if there's this more than 20 days?
So I ran this program once again and I will give more than 10 days.
OK, so I think this is just more than 10 days.
This is just frightful and it uses segmentation.
So the program has been crashed, so this is how we can crash.
The program is by Photoshop so we can now one programs and GDB and load this into GDB.
And we can wait.
So it is clearer now disassembly of our program and this system remains.
And this is the first construction.
So I'll put a great point here, OK?
And under and on the program, you are so in GDP, if you want to give the compelling arguments, you
have to give this thing run and the argument, OK, so you have to give this here.
And this is Smalley's and Dages plus.
And I think this is more than 20.
OK, so and it will start the program with the input as this is so breakpoint has been.
So if you look here and so before that, how do you think the program crashed earlier?
So as you look here in the register as this address.
OK, so what actually happens?
The faster instruction is to push these things into the stack so it'll push the R11 and so on and on
zero and a lot.
And this does.
OK, so what is this?
When the program executes, as I said in the earlier video, if I just disassemble this program.
So I learned this assembly.
Disserve mean, and if you look here, there is a pope and B.C., so after executing the instructions
in the main, the program has to return to here.
So that is why is pushing down in the stack.
OK, so after executing this instruction, the value this address will be those to B, C and the program
execution will be given to here, OK.
And the program will return to this address.
That is C..
So this is possible by this pope operation, which we see here.
That is for R11, NBC.
So this address is pushing the stack using this first instruction push on NBC.
So when you provide more than a switchover from the buffer, it will rewrite the contents in our stack.
OK, so as you know, the return address is in the stack, right?
So when we provide more than is, we can hold it to rewrite the calendar stack.
So as a result, the return address will be overridden by our ace.
When this instruction is executed, the value in the stack, would it be close to be right?
So if the program executed, normally it'll be having this return address to the Lipsey me.
So when we all read the contents in our sector is these A's will be filled in the PC.
So when the PC looks into a IS.
So as you know, the A's, that four A's will be seen as 41, 41, 41, 41.
OK, so as you know, forty one forty one forty one forty one is not a valid address.
So it does not point to any other location in the memory.
So as a result, the program crashes.
So we can just check this if we just press the various policy and the.
The program will crash and it will appear the ABC is holding out for a.
So if you look at the last thing, this is showing 60, right.
So this is in the tumble.
So the last significant bite is one.
So if that is all throughout the state of our program tomorrow, OK.
So I will explain that later.
This is not very important for our folks, but we'll be looking into that later.
So if you look looking too smart, as will be presented at 61 X, so that 60, 160, 160, 160 one is
affected here.
So.
This is how it crashes, so we don't see this as a distraction from our work and the problem stop the
is segmentation.
So this is how the flow of goods.
And so our return address is over.