A python game modding tool for the mobile game The Battle Cats that can decrypt, encrypt, and modify some game files.
It is a pretty much direct port from my C# game modding tool with a few bug fixes.
Join the discord server if you want to suggest new features, report bugs or get help on how to use the modder.
PyPi: https://pypi.org/project/battle-cats-game-modder/
If you want to support me then consider gifting me some ko-fi here: https://ko-fi.com/fieryhenry
-
EasyMoneko for the original keys for decrypting/encrypting: https://www.reddit.com/r/battlecats/comments/41e4l1/is_there_anyone_able_to_access_bc_files_your_help/
-
Battle Cats Ultimate for what some of the numbers mean in various csvs. https://github.com/battlecatsultimate
-
This resource for unit csvs: https://pastebin.com/JrCTPnUV
-
Vi on discord for enemy csvs
I recommed putting adb in your Path system variable. To do that do this:
-
If you are using an emulator: Go to your emulator's install directory, if using LDPlayer it will most likely be in
C:/LDPlayer/LDPlayer4.0
. Then findadb
in that folder (other emulators might have it in thebin
directory) -
If you aren't using an emulator Download the Android SDK Platform Tools ZIP file for Windows, and unzip it.
-
Copy the path to the directory that you are in
-
Then open the start menu and search:
edit the system environment variables
and press enter. -
Then click on the
Environment Variables
button. -
Then in the
System variables
box find the variable namedPath
, then click on theedit
button. -
Then click
New
and paste the path into it. -
Click
Ok
thenOk
again thenOk
again. -
Relaunch powershell and maybe restart your whole pc, and try the command again. If this method is too dificult, just use a root file explorer instead and manually get the files that you want. The paths that you will need are:
/data/data/jp.co.ponos.battlecatsen/files
and/data/app/jp.co.ponos.battlecatsen-1
-
Install python (If you haven't already) https://www.python.org/downloads/
-
Enter the command:
python -m pip install -U battle-cats-game-modder
into cmd or another terminal to install the editor. If that doesn't work then usepy
instead ofpython
in the command -
Unpack the apk file for the game using apktool/APK Easy Tool
-
Get the .pack and .list files that contain the files you want to edit:
-
Most stats are in DataLocal
-
Most text is in resLocal
-
Sprites are in various Server files
-
-
Then enter the command:
python -m BCGM_Python
to run the tool. If that doesn't work then usepy
instead ofpython
in the command -
Select option to decrypt .pack files
-
Select .pack files that you want, they will be in
/assets
for local files in the extracted apk, or/data/data/jp.co.ponos.battlecatsen/files
for downloaded server files -
Once completed the files will be in
/game_files
in your current working directory -
You can manually edit the data, or use the option in the tool that you want
-
Once edited, open the tool and select the
encrypt
option -
Select the folder of the game files
-
Once complete the encrypted files will be
/encrypted_files
in your current working directory -
Get your
libnative-lib.so
file for your system architecture. You can find it in:-
/data/app/jp.co.ponos.battlecatsen-1/
-
/data/data/jp.co.ponos.battlecatsen/lib/
-
-
Run the tool and select the option to
Set md5 hashes in libnative-lib.so file
-
Select your encrypted files in
/encrypted_files
in your current working directory -
Once done you can either:
-
Say yes to
push your modified libnative-lib.so file to the game
-
Replace the libnative file in the apk for a permanent change.
-
The
apk
must be signed -APK Easy Tool
- for most devices to install the apk -
Then you must re-install app or replace the apk in
/data/app/jp.co.ponos.battlecats.../base.apk
-
-
Manually replace the libnative file in
/data/app
-
Replace the libnative file in
/data/data/jp.co.ponos.battlecatsen/lib
only if you modifed server files for your device.
I recommend doing 1 and 2 for local files. And all 3 for server files.
-
-
You now need to put your encrypted files either into:
-
The apk if you modified local files
-
The
apk
must be signed -APK Easy Tool
- for most devices to install the apk -
Then you must re-install app or replace the apk in
/data/app/jp.co.ponos.battlecats.../base.apk
-
-
/data/data/jp.co.ponos.battlecatsen/files
if you modified server files
-
-
Open the game and see if it works
-
If you modifed server files, you will need to find the associated
download.tsv
file for your .pack and .list files in the apk in/assets/{language}
-
Open the file in notepad, you will see the
name
of the file, then a tab, then thefile size
in bytes, then a tab, then themd5 hash
of that file. -
You need to modify that
md5 hash
so that the game doesn't re-download the server data -
Go to here: https://emn178.github.io/online-tools/md5_checksum.html and drag and drop the file in
-
Copy the hash and replace the one in the
tsv
with that one. -
Replace the apk in
/data/app/jp.co.ponos.battlecats.../base.apk
with your apk, useapktool/APK Easy Tool
to sign the app and pack it into an apk again. -
Open the game and see if it works.
-
If it re-downloads game data maybe also try to replace the
file size
in bytes for the .pack file. Right click->properties->Size (not Size on disk)