Hello and welcome back.
Remember the objective of this correct me is to patch e x value if the correct value.
So let's get started.
That is open.
The correct me the x 60 for the Beattie
and make sure your options are set as follows.
Option references and check system break point and check deal s convex.
And make sure these exceptions he not so we are now and the entry point in that is no trace.
Hillary you over instead of pressing heavy recall that we can do this
so we will all to f it for you all the way until the program is running and you can see the status it
is running and now the last call there was me he is this call.
This is a call because it will run.
So now we should put a brake by here so that we can step into it in the next restart.
The ability to set a break point and necessary start.
Now let's run to our break by clicking run and now we add the break point that is step into it by pressing
F seven
and we want to know what causes the program to be unregistered so we price effort to step through and
of the call and when we come here we see this series of moves to X.
And here is the comparison in the test.
Here you see there is this tree registered and it is also an unregistered string and the jam here in
Germany is over to avoid the good string and goes to the bat string so this is what causes it to be
hungry this.
So that is f a step audits and confirming f now you can press F 9 are playing on this and you can see
it issuing unregistered so it is registered obviously came from here.
Because of this test.
And this test dependent on the value of an E X soonest put a new breakpoint here and restart the program.
Run to our first break point which is this run to our second Bitcoin which is this test so it is this
test here which test whether the he s value is 0 in the past we have seen the test.
Yes comma E X means is x value 0.
So it is asking whether x is 0 so if EMC 0 every say zero reflect the true.
In this case he x is zero.
Therefore the Zero flag is set to 1.
So if you press F it now jam equal just equal to 1.
That means this jam will take place.
It is you will fly is one.
So in this case you reflect this one so easily done.
So over here we can write a comment and this is how you write comments.
You can double click here.
In this column and put a comment
should not John so this is glad you know that you should not jump over here because if you jump you
will land in the back message.
If you were doing John you will go on to show that good message which is called is registered.
So over here we shoot on June 10.
So now the question remains.
We can go up one step further.
What sets it yes value so we can see the expertise to be set over here.
This is a one we says yes value so we can go up here and put a breakpoint but we are not sure whether
or not this instruction will be reached because there is a jam here.
We seem to jump over this instruction so the current rate should be set over here to see whether or
not or why he jumps over this instruction.
This is a good instruction because it says that yes to to give the 80s zero then he will cost these
two jam videos is.
This will not jam because it is not equal to zero.
Therefore this is a good instruction.
We won this but we have to analyse why this is jumping over it.
So we should put a brake point here and we can remove this refine and restarting the program.
Now we run to the first very point I think we can remove the flash point.
Now we run to our second big line.
She's here so you can see it is jumping over these good instruction.
And this only is her should not jump so we can put another comment here.
Yes like how we did earlier.
Yeah.
We put a comma here.
Should not jump this one also should not jump.
So you can write a comment booklet
should not jump click.
OK so here we should not jump just like here.
We should not jump.
So what determines whether this will jump or not.
Again the test is in jump equal.
That means it would jump if the zero flag is equal to one which is in this case the Zero flag is equal
to one because of this tax here.
The test he would check whether he is he to one.
Just like here.
So what sets a year yes.
To be one or not depends on the preceding quote.
So you can see here a most 5 to the X most 5 to his X and the ducks or minus is X from X and store the
result in here x.
These instructions suck.
Yes come is the X means take the value in here X minus from the value of an E X and start resulting
x.
So if easy access on the value five you would take five minus five from here which is zero and install
zero back in x.
So this is what is causing you X to become zero.
And that is that you got to eat X is zero then this region.
So where do you think we should patch here.
So you can batch here.
We must ensure that this instruction either does not happen or we must set the value of yes to anything
other than zero so let me show you one base is set to not be operation which is one option.
And the second option is to move a value one into e x.
So let's try the second option double click and make sure you check on sites give size.
And this is also checked.
Let's move E A X
one and you can see the instruction is bigger by 23 bytes.
That means we can assemble this here because we assembled this evil user.
The two bytes here and then use another bite from here and then we destroy this instruction which we
can do we need this test.
So we don't want to decide this instruction.
So what do we do.
We can move one to a out instead of X a movie to here and we have seen in the earlier lesson that he
is referring to the two bytes down here so this is air.
So if we move one where he actually becomes zero zero zero zero zero zero zero one which is 2 1.
So that is high.
We can do this and you can see the instruction is the same size.
So this is OK.
So we can click or kina
close this.
Now we have assembled more one two here so that is OK so let's go ahead and fetch it file.
That's fine.
Quick batch it a new name correct me seven ish batch C K closes and let's load the file load the batch
FA open and run it and you can see successful test it does not reach registered.
So this is a good lesson on the how to trace you X and how to badging the correct value.
Many programs out day depend on the result of X in order to determine whether or not the surveys are
registered and X is usually set and by a function call which returns and also set and by other comparison
operations which usually starts the result of the operation comparison inside here x.
So by patching x you can actually cause software to become registered.
So thank you for watching.
I'll see you in the next lesson.