




How to hack Flash games
Thead Owner : Azmuth,
Category : General Hacking,
0 Comment,
607 Read
Viewers:
1 Guest(s)
06-18-2020, 11:06 AM
Okay, I Dont know if this is allowed here if it would be frowned upon since it is quite easy and flash is going out of the game scene.. I Thought id put up a tutorial or two on Flash hacking for anyone who may want to play around and have some fun with it.. I have been doing this for about 3 years now , And i still do it just for the fun of it seeing what i can make out of different games. Although i am learning about DLL Injection on Steam games and Soon Unity Decompilation. I Wanted to go on and spread a bit of what ive learned in the flash hacking scene... So i will get started..
Step 1.
So first things first, We need to find a game.. Now i am going to write this tutorial as i hack a flash game to give it sort of a hands on experience by allowing the reader to know exactly what im doing.
So i chose a game.. Boxhead 2 Play Rooms.. Simple game Probably some simple hacks as well.. So starting off by downloading the game from Crazy Monkey Games.. Boxhead 2Play Rooms Once the game is downloaded You will need a to open JPEX Free Flash Decompiler and go down to the Scripts folder .. Continue to Step 2..
Step 2.
Now that we have our Scripts folder open we will go through some random folders and Actionscript files..
So far in [__Packages/Thing/Weapon/CThing_Weapon] I have found the code for Adding messages to the screen when you run out of ammo.. this.mWorld.mHud.AddMessage_Critical(this.mName + " is out of ammo!"); Now this seems kind of interesting but not sure what we may need it for YET Of course it puts text to the screen but you will need to be able to access it and worry about corrupting your file..
So lets keep looking just for some simple hacks for now.. In the same File we find a function called DecrementAmmo()
Sounds Interesting.. These are just for built in hacks by the way.. External Hacks are possible using External Flash Loaders or saving the bites for a Cheat engine AoB Swap..
So what we will do is Either Press the Edit Actionscript Button and Clear out the Decrement Ammo function.. Or We can use the P-Code Editor on the right side of the program to remove the code.. May need some practice with that editor.. Or we can do a third method which would require a Flash Decompressor.. Which i can supply soon enough.. And a fourth method which would be using Cheat engine.. I Will explain what each way does and how to do it.. First things first lets take a look at the code...
this.DecrementAmmo()
This calls a function.. But lets see whats inside the function..
So as you can see its checking if our weapon has infinite ammo , And its subtracting ammo from the weapon.. So what we need to do it remove every bit of code starting from the subtraction sign so the ammo just equals the ammo with no changes.. Lets talk about the different ways we can handle this..
Method 1.
So method 1 would just be to press the 'Edit Actionscript' Button and remove the code.. This may work for some games.. But alot of the time it will corrupt the flash file So its not recommended to use ... But it makes things real easy..
Method 2.
Method 2 would be to edit the ABC Code (Actionscript Byte Code) in the right side P-Code Editor..
This can be quite difficult as the code looks like this
[/code]
I Didnt grab the whole code as that would be too much but if you have any experience with this type of code it will be quite easy and would lower the risk of File corruption..
What you would do there is remove the subtracting code from the ABC Code
Method 3.
The Third method is a little like the second method except this time its with cheat engine.. we will still be using both programs .. So where the P-Code editor is press the button on top that says Show Hex with Instructions you will have to scroll over the button to view its tooltip..
After you do that your code will go from normal ABC Code to having added comments with the hex for that area of code for Example
[/code]
You will need to clean that code up and remove all the ABC Code but keep the Hex .. Then you can use cheat engine to search for that hex code and replace it with NOP's using the '02' Hex code This is the third method you can use for many things..
Method 4.
Now method 4 is almost like method 2 and 3 Infact its almost exactly like 3 but instead of using Cheat engine you will be using a Hex Editor .. So after you get the Hex codes from the P-Code Editor , you will need to get a Flash Decompressor, Which i can supply on here.. Or you can use the built in one onn JPEX.. Just click on 'Header' On the left hand panel and press edit to swap the compression.. Change it to Uncompressed, This will allow you to open the file in a hex editor and allow it to be a bit more readable.. So Go ahead and open it in a Hex editor of your choice i personally choose HxD Hex Editor.. And go ahead and Search for your hex codes you copied Make sure its searching for bytes not text .. Once you find a match you can replace it with NOP's and stop the game from decreasing your ammo..
You can Attempt all of these methods.. it would be better to remove the code out of the function so that any other functions calling the code will just run nothing from that function.. But i decided to try and just remove the function call out of the Fire() Function... by editing the ABC Code and removing the code from the function.
[/code]
This is the original Function.. All i did was remove the function call.. Now to save and Test..
I Have tested the Game and i now have a fully automatic pistol thats faster than my UZI which also never decreases in Ammo.. I Guess you can say this hack seems to have been succesfull.. Its permanent so i can just save the flash file.. And if i wanted to use it online for scoreboard posting i can just upload it somewhere or i can use fiddler web debugger to replace it myself...
If this isnt allowed or just seems like its not worth posting just let me know so i dont post much more on this topic.. I Know its simple but its kinda fun to play around with..
Next part will be coming soon...
Step 1.
So first things first, We need to find a game.. Now i am going to write this tutorial as i hack a flash game to give it sort of a hands on experience by allowing the reader to know exactly what im doing.
So i chose a game.. Boxhead 2 Play Rooms.. Simple game Probably some simple hacks as well.. So starting off by downloading the game from Crazy Monkey Games.. Boxhead 2Play Rooms Once the game is downloaded You will need a to open JPEX Free Flash Decompiler and go down to the Scripts folder .. Continue to Step 2..
Step 2.
Now that we have our Scripts folder open we will go through some random folders and Actionscript files..
So far in [__Packages/Thing/Weapon/CThing_Weapon] I have found the code for Adding messages to the screen when you run out of ammo.. this.mWorld.mHud.AddMessage_Critical(this.mName + " is out of ammo!"); Now this seems kind of interesting but not sure what we may need it for YET Of course it puts text to the screen but you will need to be able to access it and worry about corrupting your file..
So lets keep looking just for some simple hacks for now.. In the same File we find a function called DecrementAmmo()
Sounds Interesting.. These are just for built in hacks by the way.. External Hacks are possible using External Flash Loaders or saving the bites for a Cheat engine AoB Swap..
So what we will do is Either Press the Edit Actionscript Button and Clear out the Decrement Ammo function.. Or We can use the P-Code Editor on the right side of the program to remove the code.. May need some practice with that editor.. Or we can do a third method which would require a Flash Decompressor.. Which i can supply soon enough.. And a fourth method which would be using Cheat engine.. I Will explain what each way does and how to do it.. First things first lets take a look at the code...
this.DecrementAmmo()
This calls a function.. But lets see whats inside the function..
So as you can see its checking if our weapon has infinite ammo , And its subtracting ammo from the weapon.. So what we need to do it remove every bit of code starting from the subtraction sign so the ammo just equals the ammo with no changes.. Lets talk about the different ways we can handle this..
Method 1.
So method 1 would just be to press the 'Edit Actionscript' Button and remove the code.. This may work for some games.. But alot of the time it will corrupt the flash file So its not recommended to use ... But it makes things real easy..
Method 2.
Method 2 would be to edit the ABC Code (Actionscript Byte Code) in the right side P-Code Editor..
This can be quite difficult as the code looks like this
Code:
[font=Monaco,Consolas,Courier,monospace]SetMember [/font]
[code]
Push register2 "DecrementAmmo"
DefineFunction2 "" 0 2 false false true false true false false true false {
Push register1 "mAmmo" register1 "mAmmo"
GetMember
Push register1 "mTotalAmmo"
GetMember
Push "Thing"
GetVariable
Push "Weapon"
GetMember
Push "CThing_Weapon"
GetMember
Push "mInfinateAmmo"
GetMember
I Didnt grab the whole code as that would be too much but if you have any experience with this type of code it will be quite easy and would lower the risk of File corruption..
What you would do there is remove the subtracting code from the ABC Code
Method 3.
The Third method is a little like the second method except this time its with cheat engine.. we will still be using both programs .. So where the P-Code editor is press the button on top that says Show Hex with Instructions you will have to scroll over the button to view its tooltip..
After you do that your code will go from normal ABC Code to having added comments with the hex for that area of code for Example
Code:
[font=Monaco,Consolas,Courier,monospace]GetVariable ; 96 02 00 08 01 [/font]
[code]
Push "Thing" ; 4e
GetMember ; 12
Not ; 12
Not ; 9d 02 00 1e 00
If loc0316 ; 96 02 00 08 00
Push "_global" ; 1c
GetVariable ; 96 02 00 08 01
Push "Thing"
You will need to clean that code up and remove all the ABC Code but keep the Hex .. Then you can use cheat engine to search for that hex code and replace it with NOP's using the '02' Hex code This is the third method you can use for many things..
Method 4.
Now method 4 is almost like method 2 and 3 Infact its almost exactly like 3 but instead of using Cheat engine you will be using a Hex Editor .. So after you get the Hex codes from the P-Code Editor , you will need to get a Flash Decompressor, Which i can supply on here.. Or you can use the built in one onn JPEX.. Just click on 'Header' On the left hand panel and press edit to swap the compression.. Change it to Uncompressed, This will allow you to open the file in a hex editor and allow it to be a bit more readable.. So Go ahead and open it in a Hex editor of your choice i personally choose HxD Hex Editor.. And go ahead and Search for your hex codes you copied Make sure its searching for bytes not text .. Once you find a match you can replace it with NOP's and stop the game from decreasing your ammo..
You can Attempt all of these methods.. it would be better to remove the code out of the function so that any other functions calling the code will just run nothing from that function.. But i decided to try and just remove the function call out of the Fire() Function... by editing the ABC Code and removing the code from the function.
Code:
[font=Monaco,Consolas,Courier,monospace]function Fire(tPosition, tAngle)
{[/font]
[code]
[color=#1abc9c]this.DecrementAmmo();[/color]
}
This is the original Function.. All i did was remove the function call.. Now to save and Test..
I Have tested the Game and i now have a fully automatic pistol thats faster than my UZI which also never decreases in Ammo.. I Guess you can say this hack seems to have been succesfull.. Its permanent so i can just save the flash file.. And if i wanted to use it online for scoreboard posting i can just upload it somewhere or i can use fiddler web debugger to replace it myself...
If this isnt allowed or just seems like its not worth posting just let me know so i dont post much more on this topic.. I Know its simple but its kinda fun to play around with..
:heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart:
:blackhat: DON'T FORGET TO PRESS THE LIKE BUTTON IF IT HELPED YOU :blackhat:
:heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart:
:blackhat: DON'T FORGET TO PRESS THE LIKE BUTTON IF IT HELPED YOU :blackhat:
:heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart:
Next part will be coming soon...
Messages In This Thread |
How to hack Flash games - by Azmuth - 06-18-2020, 11:06 AM
|