Hello, welcome, come back in this video, I'm going to show you how to use Iida as a debugger and
also how to patch files.
So going down with this cracked me, cracked me one along with the crazy one.
That's the source code and put it in your folder.
They call Cracked Me.
Just create a new folder.
And after you done that, you can try to run it and see what he does to open the new terminal here.
And just run the creamy one, he asks you to enter key, so you enter anything you say.
Sorry.
So now I'm going to show you how to crack this.
Crack me one using Eda's debugger.
If you want to know what the creamy one Sasko looks like, you can open this in a text editor.
So it is a simple program, has got a main function and two other functions success and feel he brings
a problem and the key and ensconcing input and it in the integer variable called key in any comparison.
The key keys to to determine if it is a success function, the print Congress.
Otherwise you will call the feel function to print the sorry message and then he returns.
So very simple program.
So now let's open this in Ida.
Prickling new.
An open me one.
So this is a very small program, so the entry point is here, here and Turkey printf here and here
it Skåne, we see what the user enters and sees into verbal.
And over here, he does a comparison of nine to one which you can convert to decimal, over here you
can use a hajji as a shortcut, and then he's going to compare the value that the U.S. is to 237.
Again, if it is, then this comparison is zero.
When you say comparisons usually means that you would take X minus two, three, seven and you can resolve
zero.
So even if it's zero, zero can go to the left and you've been success.
But if the user input something which is not to 237.
So when you take X minus 237, you are not going to get zero.
So in that case, Jumblat Zero will go to the right.
And here you Greenfield.
So now we can step through this.
We can put a breakpoint here.
So it put a break point.
We can have two is a shortcut or we can go to debugger and go to the breakpoints and at break point.
So now he has an breakpoint over here.
So.
Over here is a break point and then we can run into.
And then he creates.
OK, so now if you go to the command line, you will see he has printed front and Turkey, so just about
anything he won't show presenter.
And now he has stopped our breakpoint over here.
So at this point here, you're sorry, but he asked me to 37 amnesia's taken this value in years ago
and made it to the G7.
And he wrote this result, which is.
So because it is not zero, this arrow is bringing, the Green Arrow is blinking.
And Miss Green go to the right and call the full message so you can click on the message to see what
he does.
So if you put string, Solley escaped and go away.
But we don't want anything to go in here.
You want to go to left.
So Levius, you were called a success function.
So we double click on this and as I said, function postering Congress.
So this is what you want to skip.
So how do we reverse this to me?
Go to the left to reverse years, to go to the next.
You can assemble Jersey here changes, which is not zero to become Anjum zero, so to do that and be
selected and then you go to edit, come down to that program and then click on Assemble here we just
change Channel zero to become zero.
This is how we reverse the jump in.
A number of bytes required for both zero and zero are the same.
So it's quite safe to do the embossing here.
He will not overwrite any of the subsequent code.
So click OK.
Now closes, so now you can step through this by pressing every.
So either that or you go to debugger and we're here, step over so cocky, so I step over to the left.
So now we're here and he's going to move to zero to the exit and then it's going to cost us.
So let's step over again pressing it.
I it again now.
So the court success going take a look and see the Congress.
All right.
So we have already managed to reverse this.
So now we can run all the way.
Either you click on this or you press debugger, go to F name, continue the process so you run to completion.
And now Lady Gaga has done because the program has completed.
So now if you want to bench your file, this is a father you want to pitch claim you won so far.
We created the program.
Patches to input for.
And this is a fight you're going to fetch my we want to create a backup circling on this great backup
so they can finally have a ascencion here you go in passion is fire and create a backup.
So the backup is important.
In case you made a mistake, you have a here.
We still have a copy of the file before he was patched.
So let's test our Quami One Bashforth now and see what happens.
Open the terminal here and come here and there.
You
enter any key, any prints, Congress.
So you have successfully push this far.
So I'm going to shoot another way.
So let's close this now.
Don't send me database.
And then we did this on.
And need to back to the origin of our.
All right.
New reopen the original file.
All right, so now I'm going to show another way instead of reversing the jump.
You can also tamper with the register.
OK, this time we are going to do something different instead of putting a brick here that is put a
brick somewhere else, probably all we can put a brick here.
So we have to turn this run to that compensation plan.
Yes.
OK, let's go and check the output.
So the US and Turkey, so just to anything and press enter and now he's waiting for us at a break point
over here.
So this is a break point.
So now he's going to do a comparison.
Yes.
In nine to one each.
So here we see currently the value is not the same as nine to unhitch.
So he would take X minus 91 here.
He would not have zero.
So if you want to make sure that he X minus nine to one, which is zero, we can either change the value
here or change the register to nine to one.
Right.
So this is how comparison works here.
We are going to change the value here to nine to one double click on the register and then it changes
to a nine to.
Nine to one,
right, so now when he does a comparison, yes, minus nine to one, which you would take these nine
to one, minus nine to one endeavor Gifu zero.
So zero will go to the left and show success.
He said go to the right.
OK, let us try now press Efate Stepanova, see how it is going to go to the left because the hero is
blinking and through enough he went to the left.
Now, he has shown the success message, going to check it out.
Congrats.
OK, so this is how he can modify the register itself during runtime.
But this is not pitching.
This is just modifying the register value.
OK, so these are two ways in which you can modify the behavior of a program using debugger during runtime
or there's not a thing I want to show you.
Let's start this now.
You can also do more than just modify or reverse terms.
You can also delete execution of a Russian user, has to really have to hear.
So, for example, if you don't want this thing to happen, you can just remove this by replacing these,
you know, operation.
Right.
But to do that, you need to count how many bytes you need to substitute if no abberation.
So let's convert to linear view the moving instruction.
You need to see how many advisee uses.
So good options, General.
And here she was, 16.
OK, so then you can see the.
So this instruction Russian X followed by this address value in this address takes up three bytes.
So if you're doing this instruction to happen, we can use this method and then.
Changes through base to nine zero nine zero nine zero through the program, changed by.
So this this by it'd be four or five efore, it'd be four or five efore, you can change into a nine
zero nine zero nine zero.
So I deleted sevice and I replaced your nine zero nine zero nine zero nine zero is no operation.
NLB So now you take a look.
I remove the instruction and replace it in operation.
So this is an idea you can perform in Saige, you can convert or remove any kind of instruction you
want.
The important thing is he has it must be exactly the same number of bytes so that you will not disturb
the instruction that comes after it.
Otherwise you will cost programming failure.
OK, so these are the only things you can do.
So I'm just going to control them to put it back.
That's all for this video.
Thank you for watching.