fieryhenry / mailboxhack

Script to hack the mailbox in The Battle Cats
6 stars 2 forks source link
battle-cats frida hacking scripting

Battle Cats Mailbox Hack

A hack for the mailbox in Battle Cats. It allows you to get any cat, talent orb, or item amount you want without the ban risk of other methods.

It only works on Android and requires you to install a modded apk, but it does not require root.

The main script uses TBCML, a library I've made designed to make modding the game easier and more automated.

Unlike TBCMS, this hack does not require a server to be running, all of the scripting is done on the device using Frida, specifically Frida Gadget.

ko-fi

Credits

Setup

  1. Read the TBCML GitHub page so you can get the library installed (with the scripting dependencies). At the moment you will have to install tbcml from source as the latest release doesn't have all the features needed. See https://github.com/fieryhenry/tbcml#from-source for instructions.

  2. Clone this repository, or just download script.js and script.py manually.

  3. Make sure that the 2 files are in the same directory.

  4. Open command prompt or another terminal and navigate to the directory you downloaded the files to. (You can do this by typing cd <path> where <path> is the path to the directory containing the files.)

  5. Run python script.py to create the modded apk.

  6. You may get Relocation R32 not supported! errors, this is normal and can be ignored (idk how to get rid of them).

  7. If the script fails to pack / sign the apk, then you should change loader.initialize() to loader.initialize(decode_resources=False) near the top of script.py.

  8. Install the modded apk on your device. The script will display the path to the apk file.

  9. The app should be called "Battle Cats Mailbox Hack", it won't be if decode resources is set to false. You can change the name in the script if you want, or just delete that line, it will be near the end of script.py.

  10. Open the game and go to the mailbox. You should see that you have some presents.

Customization

When you run python script.py you can pass in a url to a json file of presents e.g python script.py https://example.com/presents.json. This way you can still setup your own server to host the presents if you wanted to, or just host the json file on GitHub or something.

Alternatively you can pass in a path to a json file e.g python script.py presents.json. There is an example json file in this repository called example.json. It is pretty outdated though, and I can't be bothered to update it. But if you want to update it then please make a pull request. I got the original json file from: NekoB0x

If you use a file path, if you want to modify the presents you will have to run the script again to create a new modded apk and then install it to the device. (If you can figure out how to allow the script to read files from the device's storage then please make a pull request.)

Presents Format

The json file should be an array of objects. Each object should have the following:

Example

[
    {
        "presentCode": 1,
        "title": "Mailbox Hack",
        "body": "Made by fieryhenry and made possible\nby jamestiotio's original work:\nhttps://github.com/jamestiotio/CITM",
        "createdAt": 1574529411,
        "acceptedAt": 1,
        "items": [
            {"itemId": 22, "itemCategory": 0, "amount": 100, "title": "Catfood"},
            {"itemId": 21, "itemCategory": 0, "amount": 20, "title": "Rare Ticket"},
        ],
    }
]

Item Categories

Any game files mentioned are stored in the game_files directory of the repo.

Categories: