Tutorial How to mod .swf file on Android flash games

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,762
301,744
1,213
Modding World
This is my old tutorial but it is still relevant to this day

So today I will teach you how to mod .swf file for CSI Hidden Crimes for Android. The flash games was build with Adobe Flash Professional, based on programming language ActionScript. You just need some basic knowledge of ActionScript

Use this game to practice: CSI: Hidden Crimes APK for Android Download

Install SWF decompiler
There are many SWF decompiler softwares on the internet. if you don’t know which one, just download and install Releases · jindrapetrik/jpexs-decompiler

Open .APK file using Zip Utilities
In this case, I’m using Winrar.

Right click on the APK file, Click on “Properties”

1672837436573.png


You will see this window. Click on “Change…”

2cXhfUot0dKMykhwyg9jnqyoMqL2Z3bBhf4hVZxjJhPcI3LNJQ.png


You will see the window “How do you want to open this type of file (.apk)?”. Click on “More options” and click on “Look for another app on this PC”

1672837444513.png


Go to the path where Winrar is installed and click “Open”. Default location is Local Disk (C:) -> Program Files -> Winrar

1672837451823.png


After that, click “OK”
Open the .APK file -> Open “assets” folder and extract the “HiddenCrimesANdroidProd.swf” file to your computer

1672837454686.png


Modding .SWF file
Open the “HiddenCrimesANdroidProd.swf” file and the program will start. Note, i’m using JPEXS Free Flash Decompiler.

Before we get started, we need to download playerglobal32_0.swc from Wayback Machine. After you download it, go to Settings -> Advanced Settings -> Paths and set the path to playerglobal32_0.swc file

Image%202023%2001%2003%2010%2053%2056.png


Click on “Tools” -> “Text Search”

1672837480918.png


Search the text “get energyCount”, “get coins” or “get greenCash” and click OK.

1672837484143.png


Let the program decompiling the .SWF file and it should take 15 seconds to finish decompiling (depending on your computer CPU speed). After decompile, you will see this window. Double click on “com.hiddenobject.story.vo.GameProfileVO”

1672837487924.png


Now you will see the codes. Find the functions named “energyCount”, “coins” and “greenCash” and the code should look like this

Code:
public function get greenCash() : int
{
return getAllCurrencyType(“GreenCash”).value;
}

public function get coins() : Number
{
return earnedCoins + boughtCoins;
}

public function get energyCount() : int
{
return _energyCount;
}
Click on “Edit” the button below.

1672837492810.png


A warning message will show. You can continue it

Image%202023%2001%2003%2011%2004%2000.png


Click on “Edit” button below again, you will see the warning message and click “OK” and now you will be able to edit the code
Change them all to return 999999; like this. DON’T ever forget the “;” at the end of “999999”, otherwise the game won’t work.

Code:
public function get greenCash() : int
{
return 999999;
}

public function get coins() : Number
{
return 999999;
}

public function get energyCount() : int
{
return 999999;
}
1672837496231.png


Save the .SWF file
After you modified the code, click on “Save” button below and the code will be

1672837499412.png


saved. Now click on “File” -> “Save” and it will save modified codes in .SWF file.

1672837503154.png


Replace the modded .SWF file inside the .APK file
Open the .APK file with Winrar, open “assets” folder and replace modded .SWF file inside.

1672837506830.png


ZipAlign and sign the APK file
Now you have to zipalign and sign the .APK file using any tools, otherwise the APK won’t install on your device.

Result and proof
So here is the result. Energy, coins and cash are 999,999

1672837510078.png


Credit To:
AndnixSH
 
Last edited: