All right, guys, welcome back.
I guess the best way to learn Frida is by doing some hands on exercises.
And don't worry, I know you might not feel prepared for this one right now after only doing one example
together.
Therefore, we are also doing the next example together.
And this one I have found a very nice application.
This is a dice application and we can manipulate this in many different ways.
So this section will be a lot of fun and we will learn a lot of stuff in there.
But before we can hook method, we have to analyze this application first because we need to tell freedom
in which class, which method we want to hook and this is something we have to find out.
Therefore, let's have a look into this application and then you also have your first task over there.
We need to figure out how this dicing application works if you want to hook it.
But first, let's have a look into this one.
So here we are back on the Ubuntu VM and now let's first have a look into this application and then
what your task is.
All righty.
Okay.
I have already downloaded it.
I have it in this downloads directory over here.
It's called privacy friendly DSA.
And you can also find this application as an attachment of this section over here.
So first let's install it and have a look how it works and therefore let's establish our connection.
This one already connected.
All right.
And now let's install this application.
So ADB install privacy friendly Dyson APK.
All right, let's get the screen.
And there we go.
Here we have this application and this one is an very nice example of an application that serves and
basic tasks.
And this does not require a lot of permissions.
I'm not sure about the permissions at all.
I guess only vibrate, but we will find this out later on.
And this is something that absolutely triggers me if you have some applications that only serves a basic
task.
But these applications require a lot of permissions.
For example, access to microphone, GPS, camera, local data storage, your pictures and stuff like
this.
Therefore, I'm really glad that some authors have put this application online.
All right.
Back to this topic over here.
We've got this application we can click.
Okay.
And here we have now number of times and number of phases.
If you click Roll Dice, then we can see we have five dices and the phases goes up from or between one
and six.
If you decrease the number of dices, then we can see all those dices gets decreased over here.
The same for the number of phases.
Yes, it seems to work.
I mean, regarding to random number generators, you can never be sure if they really work, but in
this case, it looks it looks fine for me right now.
Okay.
Before we go into this, I want to give the credits to the authors of this application.
You can find us in the about page.
Here are those credits.
And yeah, we can also see this one has been released under the GPL b three, which means there's some
source code available for this application, but via us we don't need the source code over here.
This is our task we have to face right now.
So if we do not have the source code, we need to figure out how this application works and what we
need to figure out is how these numbers are being generated over here.
I mean, not regarding to the Android stuff.
For example, if we increase this one here to 12, then those numbers change to real numbers, not this
one.
The task would be how these numbers are being calculated.
So the return value over here and not stuff regarding to the layout.
All right.
I'd like to stick to the here to the common version over here, maybe with a little bit more dices.
So there we go.
If you increase those two or decrease those two parameters, we get different output over here.
But what we want to achieve is the following We want to influence or manipulate it later on in a certain
way that we can define the return value over here.
So no matter what this application is calculating, we want to overwrite this method that it's returning
our numbers.
And for example, six times six or six times one, one, one, two, three, four, five, six.
So this is the thing we want to overwrite with freedom.
We want to hook into this method, which is calculating the stuff and you want to overwrite the result.
All righty.
Okay.
So this is now your task right now, maybe one disclaimer regarding to this one.
Okay.
So before we start, I have to announce a little disclaimer over here.
So the things you've learn in this course, it's regarding to educational purpose.
This is not regarding to manipulating or cheating in gambling games.
This is absolutely forbidden.
And I strongly distance myself that this is the purpose of this course.
The things I want to teach you are regarding to educational purpose so that you that you can analyze
your own applications.
But it's not regarding to cheating in real world applications to make some money or get an advantage
out of this one.
All righty.
So sorry for this disclaimer, but it's absolutely important that we are all on the same track on what's
the purpose of this course over here.
Alrighty, perfect.
So back to the fun part over here.
And therefore let's switch back to the slides and have a look of what is your task right now.
Okay.
So your task right now is the following.
You need to decompile this application.
You can use trade excluded trade ex.
You can also use an eclipse project, whatever you like.
And then we need to identify the method which is responsible for returning these values over here,
the 61455, for example.
And then we need to understand how this method works, because otherwise we cannot patch it in a certain
way.
Maybe we do not have to understand it fully, but at least it's good if you have basic understanding
about this whole method.
Alrighty.
Okay.
So this is your task right now.
And don't worry about the free part.
We will do this together in case if you want to go alone.
And yeah, patch this method that returns, for example.
One, two, three, four, five, six or whatever you like at this point, feel free to do so.
But this is not something I expect from you right now.
Okay, so have fun and I'm looking forward to see you in the next video for this one.