Welcome back, guys.
In this video, we will have a lot of fun because we will finally prepare our trainer for this space
paying application.
I mean, we have already done the hard work, which is figuring out these methods and preparing these
free hooks.
So the only thing we are doing right now is putting them all together in a single script and providing
some fancy ASCII art.
Okay, so it might be not that fancy, at least for me, but I guess you do a better job on this one
over here.
All right.
After finishing this one, I will also provide you in final script.
So what I would like to show you over here is how we can create and train that in freedom.
So after what?
I really encourage you to try this on your own and play around with this application even further.
So maybe there are some additional interesting functions that we haven't discovered right now, and
it would be absolutely beautiful if you would send me some screenshots or short videos of your final
version so that we can see the progress we have done together in this course over here.
All righty.
Okay.
Therefore, let's start.
Let's switch to the Ubuntu VM and let's figure out how we can write our own trainer.
Let's go.
Okay, so here we are back to the Ubuntu VM and now let's have a look into the directory where all our
freedom scripts are being stored.
So for me it is within apps and space ping underscore, say the x and then freedom.
Here we have now all our free scripts and I have already prepared some kind of blueprint, this trainer
to chase.
I mean, it includes only one thing, but this is the most important part in a trainer.
It's the ASCII art.
Of course.
I mean the trainer.
It has to look fabulous.
Nice.
Otherwise you can.
You can throw this away.
It has to have some fancy ASCII artwork.
And yeah, I tried my best and let's see, what's the output of this one is.
So let's open this with visits to the code.
All right, here we have it.
I mean, in the final version, I give it another try.
I try to make this a little bit more better right now.
But for this video, I guess it's okay.
So we have our fancy spaceship over here.
We've got all these these space things and we've got our text and trainer for this space ping, AB Udemy,
absolute laser.
And it's even more elite.
All right, so this is our, our entry point of this, of our trainer.
So the only thing we need to do right now is and copy pasting all these free scripts into this one to
have it in a single one and then linking these functions over here.
So I guess the best idea is when we simply do it right now.
All righty.
So the only thing we need to do right now is copy pasting all our functions into this single script
over here.
And then we need to reference them over here that the user knows what what he or she has to enter to
call this function.
Maybe.
Let's do an example over here and first let's print out this ASCII function, this one over here, because
this one is just a function definition and here it's now being finally called.
So when we start filled up with this script over here, this nice ASCII art, I hope it is nice, will
be printed out in our terminal.
Maybe.
Let's do this one over here first and then we do it step by step.
So we are using the virtual machine because on the smartphone, unfortunately some libraries do cause
some trouble in Frida and therefore we are using the virtual machine for now we are connected and let's
start the Frida server data, local temp, Frida server and this one is now running in the background
and let's get this screen here we have it and we put this on the right and this one on the left.
Okay, let's open our Space Panga.
But let's see.
Maybe we have to flush this application because we are already level 11 and I guess our high score is
pretty unbeatable right now.
So we close this one over here.
And then we go into settings.
Then EPS.
This pace paying.
Storage.
And we hit the clear storage button and then we can see this data here will be deleted.
And now we've gotten a fresh version.
That started once again.
All right.
Here we have it.
Now we can see level five score and high score, and let's create some space.
And then I can I can keep talking while we are not getting hit.
All right.
So now let's start free Deb with the script on the left.
I mean, it's doing nothing then just printing out this amazing ASCII art.
But nevertheless, let's do this.
So free the dash you then the package name.
Meanwhile, I know this.
I guess.
I guess it's this one.
Okay, if you get this arrow, I'm not sure what's happening right now with 3D.
Also, sometimes these package name cannot be found, but it's accepted.
This package name.
What we can do instead using the package name is using the the process ID.
So we are using ADB Shell and then let's put this little bit larger.
Then we're using PS Dash A to print out all these processes and then we are grabbing for this paste
pane.
Here we have it five, four, five, five and now we're using free dub with this process ID and this
should work so free to dash you then it process ID and then we need to call our script which is in apps
is paste paying x.
Frida and then the train.
All right.
Sorry.
I would like to story again.
All right, let's put this on the left and let's call it a script and see what's happening.
I'll give you effort, but the function is not being called.
That's interesting.
Let's call this manually.
All right.
Here we have it.
This is what we should get when we start the script over here.
Maybe I haven't saved it right now.
Okay.
So what we need to do is we need to copy, paste all of our scripts into this one over here, and then
we need to reference this one.
And I mean this one over here.
It's not rocket science.
So we are just copy paste now all together.
Let's open another script and for example, the invisible function in this one.
Let's copy this into our trainer and then we need to provide a new function for this one.
And we also make a comment, make the player invisible so we are not providing this function and we
name this function invisible.
This is what the user has to enter afterwards.
All right.
After calling this or after we are calling this function, we are printing out the ASCII once again
because then we we can keep track of certain things.
Okay.
So now this is the the invisible function.
And we have to tell the user what what she or he has to do.
So we copy, paste this console log and then we are using simply.
I have also I could have also rewritten this, but never mind.
Okay.
To make the player invisible, we need to enter invisible.
Make the player invisible.
And now you see what's behind this trainer.
I mean, this trainer is simply just an wrapper for all these functions.
So we have all these functions in one script and we can be simply calling this function on the free
to command line.
This is odd, but it's absolutely freaking amazing having this all in one file.
Let's see, we save this file.
Now we get back to our freedom terminal and we can see now we have this this updated version, invisible.
Make the player invisible.
All right.
So let's let's keep this a little bit in foreground.
Okay.
So now we have Justin Foreground and let's see if you want to make the player invisible.
All we need to do is simply type in invisible.
Let's see.
There we go.
The player is now invisible.
All right.
The nice thing about the script is we can also take yeah, we can take track of all these functions,
for example.
And let's see.
Let me close real quick.
Okay?
I mean, we do not need to have this debug output right now.
So, for example, we can say we can create a new variable maybe let's do this over here.
So for example, over here, maybe let's create a new variable player invisible and the start flag is
set to false.
All right.
And now if the player is being set to invisible, we can set this to true.
And now we can say, for example, this one over here in the player is and then we can provide this
variable player invisible.
All right.
I guess we have to put this on top of it.
Otherwise, it might not be the state might not be clear.
And then we can also play around even further.
For example, let's see, we've got also the function set player visible.
And now let's see.
So what we can do is we can do the following.
I clear this one.
Here we click.
Okay, if the player is invisible.
Then we can call the instance method set player visible.
Otherwise.
We this one over here.
Okay.
Let's comment this real quick.
If the player is invisible.
Make it, make the player visible again.
And here I'll set the player invisible and to keep track of the stage.
I guess the easiest way is simply just inverting this one over here so we can invert it, I guess.
In this way.
Yes.
O'Reilly.
Okay.
Maybe we should talk about this once again.
So if the player the player is at the beginning not invisible, so the player is visible and therefore.
If you're calling this function invisible, then the player will be set.
This one is false.
So the player will be set invisible.
And this one, this will state this would change the state from false to true.
On the first time, if you're typing in this function once again and then you player is invisible,
which means we go into this function which sets the player visible once again, and this one, this
will change from true to false, which means the player is now invisible.
Alrighty.
Maybe let's have a quick look into how it works over here.
And then yeah, we will talk about all the other functions.
So I just want to provide you some, some approaches on what you can do in this trainer over here.
I mean, it's, it's just basic JavaScript code.
But yeah, nevertheless, I would like to give you some opinions options about this one.
Okay.
So we save this file and now let's get screen copy once again.
So here we have our application and we need to attach to this one.
Therefore we need to get the process ID
right here.
We have it start this application and we create some space first.
All righty.
Let's put this on the right.
This one on the left.
And now I'm free to dash you in this process.
ID, and then our trainer.
Let's see.
Maybe I've got it in the history that we have it.
So let's do it this way.
All right.
Now, the ASCII art should be printed out.
This one over here, and also the state of the player if it is invisible or visible.
For a moment I thought the player is invisible, but now it's still here.
Okay, so let's do this.
When we hit enter here we have our fancy ASCII art and we can see the player is forwards.
So I did forget some text here.
The player is the player.
Maybe the steward is the player invisible.
Okay.
We save it.
No, it's the player.
Invisible note, etc. for.
All right.
If you now type in invisible and then we can see the players being invisible and we can see the player
is now being invisible, set to true.
So this is why I would like to keep this this ASCII art over here.
Sorry, not this ASCII art dysfunction over here also printed out after we have called this function
so we can keep track of certain events, how the lives are being changed, the high score, things like
this.
Because if you are playing too much about this, we do not know if certain flags are set or not.
All right, perfect.
If we call it now, once again, invisible, we can see the player is back again and we can see is the
player invisible fault?
No, that's not the case anymore.
All right.
Do not borrow you right now.
I will fast forward this in copy, pasting all the other functions into this one, and then we will
make some little adjustment on to make the trainer even look more nice.
All righty.
Let's do this.
So I close this one over here, and now we copy all these other functions in this file, and let's go.
Okay.
So here we are back.
I have.
Yeah, I have copy pasted all this function and I have made some little adjustments.
For example, I have disabled all these debug outputs because this will flash our trainer with a lot
of unnecessary stuff and within the rapid fire of, for example, this one over here, within the high
score, we have to provide a new high score in this function and we are passing it directly to this
one over here.
So yeah, then we can, we can call this function with the new high score and we can use this high score
over here.
This would set a new high score, but with any rapid fire function, I guess that's really not the best
approach.
If we are using this within a trainer and having a wide loop like we have done this before, then this
would block the threat and the trainer might be unusable afterwards.
And therefore I'm just using it for a short amount of time.
And yeah, maybe we will figure out how we can do this better over here.
So how we can have rapid fire, but without blocking a lot of time in our train over here.
I will do this in the final example, but I feel free to also look for additional functions that achieve
this one over here.
All righty.
Perfect.
So now we save this one.
And let's see, I haven't tested it yet, so it might be full of errors.
Let's see with the save button.
Okay.
On the output.
I mean, we have to we have to do a better job.
This looks absolutely messy beside our ASCII art, but it seems like all these functions are now in
there.
So let's see.
Let's get back our screen copy and let's play around a little bit with this one.
So we keep this in foreground and let's see, what do we have?
We have ADD player, for example.
Yes, this works perfect.
We have coins also working perfect, a high score and we have to provide a new value.
Let's set that 2000.
And this seems to not work right now.
Or am I missing something?
We have to check what's wrong with the high school.
And let's see.
Invincible.
It's a function.
Yes.
Let's see.
Do we have an interesting.
Are only fetching.
And let's see.
Yes.
And so the first object over here, this has no collision detection anymore.
But the second object.
All right.
This is a little bit wired right now.
What happens if we call this multiple times to all objects being set?
But let's see.
No.
Okay.
So adding a player in this function, this bakelite collide.
Right now we we have to notice all we have to do and better chop on this one.
Last but not least.
Sorry.
Last but not least, let's test this rapid fire.
And let's see.
It's not a function.
So what we have named it.
Yeah.
Now I found this error.
Sorry for this.
I have used this sloppy version, so we've got our own match, but we are missing the incomplete callback.
I'm sorry for this one.
All right.
I guess this should work right now.
Let's save this.
And now let's call it.
Yeah but the the for loop this one over here is I guess way to less maybe let's increase this to than
10,000 this would block a lot of our of our trainer so yes we can see it's working and now it's good
it blocks a lot of our trainers so we cannot use other functions while we are doing this.
So therefore, I guess we should find a better way.
All right.
The thing we are missing right now is the high school.
So let's see what what's go wrong in there?
High score value.
This variable is not being used anywhere.
Okay.
So I guess instead of calling this function set if new high score, let's simply use our first approach.
This one.
This is the most.
Oops.
Sorry.
This is the most reliable version.
All right, so travel, dot, perform, and let's use this one.
All righty.
And now we are using this high score value over here.
Yes.
So this should work right now.
So we could also use the the high score over here in our trainer right now.
So maybe let's close this one over here.
That's a little bit disturbing.
All right.
So, for example, we can create a new variable, which can.
Yeah.
Which keeps track of the current high score.
Maybe.
Let's do this real quick.
So we are creating here a new variable.
User use a high score is equal to zero.
Yes.
So we have to call it once, because at the beginning it's zero.
But after we have called a new high score, then we can also keep track in our application.
I mean, we can also use an additional function.
For example, we can do it in the following way, maybe let's do it over here.
So we, we copy, paste this function and then we get rid of this one.
Yes.
We can use and get a high score.
All right.
Now I get high score.
We are fetching the current high score.
We are not setting a new one.
So this one is not required.
All righty.
Yes.
And we also disable this phone over here.
Okay.
So let's clean these gaps a little bit.
Perfect.
So now at the beginning, we can call this function get high score.
Or here, for example, or maybe even further, for example, over here, and get the current high score.
And this will assign this user high score value and then sets a new high score.
And then we can say, for example, current is something like this.
All right.
So you are setting a new one, but we can also keep track of the current high score.
I mean, this now looks absolutely messy, but it's just.
Yeah, it's just what is possible in our trainer and how to achieve certain things.
All righty.
Perfect.
Okay, let's save this one and let's see if it's working.
Yeah, here we can see that's a new high score.
Current is 625.
Let's open up screen copy.
I'm perfect.
It's working over here.
Now, let's see if we can also set a new one.
High score.
It's over 9000.
Yes.
Perfect.
Now it's working exactly like you would like to have it.
And we can also see, oh, we are not calling.
I have forgotten something in all these functions.
We are not calling this print.
Ask you once again.
So this is something we need to add at the end to all functions.
Yes.
I mean, we can also we can also use the on complete method, but at the end, it's also perfectly fine.
All right.
Now we can see the current high score.
Is this one perfect?
Okay.
So this is all for this video.
Right now.
We have seen how we can create a little trainer.
I mean, regarding to the output over here, this can be improved a little bit.
Yeah.
So we can keep track of certain states and we can also apply our fetch values from the existing game
and we can have a lot of fun in manipulating the other functions.
All righty.
As already mentioned, if you play around with this one and create a trainer, feel free to write me
a message with your result.
This would be absolutely amazing to me to see your result on this one, and I'm pretty sure I would
be highly impressed what you have created over here.
This is all for this video right now.
This is just the high level approach.
As already mentioned, you can find a more detailed version in the attachment of this section over here.
I had a lot of fun and I hope you to feel free to play around with this one.
In case of any questions, write me a message.
I'm super happy to help you out on improving your own trainer over here.
Alrighty.
Perfect.
Okay, so this is all for now.
And yeah, I'm really looking forward to see you in the next video.
See you there.