Tutorial How to hack Flash games

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Xploit

Ride the Pony
Dank Tier Donator
Nobleman
Dec 27, 2016
142
1,228
1
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

C++:
SetMember
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

C++:
GetVariable
; 96 02 00 08 01
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.

C++:
function Fire(tPosition, tAngle)
   {
this.DecrementAmmo();
   }
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..



===

How to Hack Flash Games Part 2 : Hex Editing Built in Hacks

Okay so here is Part 2 of the tutorial, I Decided to just add it into here so i dont flood the forum with new Topics on hacking flash games when you can learn everything here !


So First things first lets grab a Flash Game ! For this tutorial i will be using Zombies in Your Backyard

Go ahead and Download this game and Open it in JPEX's Free Flash Decompiler !

Now that its loaded up, You will notice the codes a bit different if you explore it a bit , Thats because Boxhead was in Actionscript 2 and this game is in Actionscript 3 using the Flixel game library , Flixel is actually really fun to play with but today were gonna do simple hex editing..

So first things first go to the Header of the flash file and set its compression to Uncompressed and save it , So thats its uncompressed you can open it up alongside in a Hex editor..

Now that you have it opened in both JPEX and a Hex editor lets get to Hacking !

Go ahead and run through a couple folders and files and take a look around , Right now we will be going over to Scripts/Playstate This is where most of the Gameplay code is , Usually i would search the Actionscript code using CTRL + F and looking for the two characters '--' which means to Decrease, Which if you do search for that you should find a code around line 462

C++:
this.currentGun.ammoLoaded--;
We're gonna want to remove that code so go over to the P-code Editor and enable the viewing of Hex Comments as mentioned in part one.. it seems from the P-code Editor Lines 939 Through 958 are the codes that create the code above.. So were gonna want to NOP it out.. Go ahead and copy the code from the P-Code editor

C++:
; d0
getlocal_0
; 66 1f
getproperty Qname(PackageNamespace(""),"currentGun")
; 2a
dup
; 63 08
setlocal 8
; 66 24
getproperty Multiname("ammoLoaded",[PrivateNamespace("Gun"),PackageNamespace(""),PackageNamespace("org.flixel"),PrivateNamespace("Gun.as$284"),PackageInternalNs(""),Namespace("https://adobe.com/AS3/2006/builtin"),PackageNamespace("com.newgrounds"),ProtectedNamespace("Gun"),StaticProtectedNs("Gun"),StaticProtectedNs("org.flixel:FlxSprite"),StaticProtectedNs("org.flixel:FlxObject"),StaticProtectedNs("org.flixel:FlxBasic")])
; 93
decrement
; 63 09
setlocal 9
; 62 08
getlocal 8
; 62 09
getlocal 9
; 61 24
setproperty Multiname("ammoLoaded",[PrivateNamespace("Gun"),PackageNamespace(""),PackageNamespace("org.flixel"),PrivateNamespace("Gun.as$284"),PackageInternalNs(""),Namespace("https://adobe.com/AS3/2006/builtin"),PackageNamespace("com.newgrounds"),ProtectedNamespace("Gun"),StaticProtectedNs("Gun"),StaticProtectedNs("org.flixel:FlxSprite"),StaticProtectedNs("org.flixel:FlxObject"),StaticProtectedNs("org.flixel:FlxBasic")])
Lets Clean this Up Remove everything that isnt a Hex Code..

C++:
d0 66 1f 2a 63 08 66 24 93 63 09 62 08 62 09 61 24
Here is our code.. Now lets get to our Hex Editor..

Go ahead and press CTRL + R To Open up the Replacement menu..

Enter the Details like so

C++:
Find       : d0 66 1f 2a 63 08 66 24 93 63 09 62 08 62 09 61 24
Replace : 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
Make Sure your Replacing Hex Values not Text Strings as you can Specify below the Text Boxes.. Then just press Replace All.. After it replaced the One Occurency.. go ahead and press the Save Floppy Disk up top.. But if your unsure of a hack go ahead and just choose 'Save As' under the File tab and create a new file... Now go Ahead and Test the game out..
As you can see your pistols Clip never Decreases below 8 bullets.. That is because you Removed the Decrement code for the Ammo .. Well you just NOP'd it out meaning you replaced it with No operation , If you tried to Remove the code completely it would change the file size making it smaller.. Seems good to make it smaller right? But its alot of work as you need to update the file size in the files headers which you would need to learn about, its at the beginning of the flash files hex code right after where it says FWS or CWS or ZWS Which are the Compressions a flash file can have..
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
Xploit thanks for sharing your knowledge, we are lacking content on the subject of flash games so this is nice to have. May I suggest a video tutorial next with voice?
 

Xploit

Ride the Pony
Dank Tier Donator
Nobleman
Dec 27, 2016
142
1,228
1
Rake;46742 said:
Xploit thanks for sharing your knowledge, we are lacking content on the subject of flash games so this is nice to have. May I suggest a video tutorial next with voice?
I Have a series on Youtube but i need to Re-Create them cause the mic on my computer is real crappy you could barely hear me , and the first tutorials i did were using a computer created voice lol , so id have to remake all the videos , But as soon as i get some better wifi i should have some more up and ill share them with everyone here , For now if you'd just like to check them out i have them all in a Playlist , I've learned quite a bit more since those videos as before i was just changing variables and creating built in functions for built in keyhacks , but there are ways for external hacks using other flash files to load the game and connecting to its classes then changing variables from the loader using static variables


Did editing my post completely remove it?..
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
Did editing my post completely remove it?..
Because you're below post threshold, your post got moderated after being edited. You'll be outta that soon :)
 

Xploit

Ride the Pony
Dank Tier Donator
Nobleman
Dec 27, 2016
142
1,228
1
Rake;46751 said:
Because you're below post threshold, your post got moderated after being edited. You'll be outta that soon :)
Ahh okay lol , I Thought i had went over a character limit or something and broke it lmao , i just added a second part for Hex Editing Flash games which you can also use the same method to add or remove Something called String Obfuscation , which is renaming all the classes and functions to invalid characters which will break most decompilers but flash will still allow it to run with no problems , And JPEX can bypass it easily lol

By the way did my other topic for my Flash loader Release get closed? or did it just glitch out?
 
Last edited:

Xploit

Ride the Pony
Dank Tier Donator
Nobleman
Dec 27, 2016
142
1,228
1
Rake;46762 said:
glitch I guess, it's there
Wow these forums look way different on mobile lol , & yeah i see it , before it was sending me to a page telling me to contact an administrator if i believed i clicked a valid link
 

NotRealy

Dank Tier Donator
Apr 30, 2019
8
102
0
When you do this, the changes are only visible for the client ?
Like it doesn't work for MMO FLASH games browser ? Every important things will be server sided and unchangeable for a player, right ?
 

Xploit

Ride the Pony
Dank Tier Donator
Nobleman
Dec 27, 2016
142
1,228
1
some things can be server sided but there are some things that make changes like let's say to your account or if you never run out of ammo if the game is only checked to stop the gun when your out of ammo n you cancel that from being sent to the server it will always be infinite lmao
 
  • Like
Reactions: NotRealy

NotRealy

Dank Tier Donator
Apr 30, 2019
8
102
0
some things can be server sided but there are some things that make changes like let's say to your account or if you never run out of ammo if the game is only checked to stop the gun when your out of ammo n you cancel that from being sent to the server it will always be infinite lmao
Ah yeah nice, it is not about ammo in my game, but i'm pretty sure there is much things i can do !
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods