Modding The Tap Titans Save File

Recently, I’ve been stumbled on Tap Titans one of mobile game on Android and iOS which is really simple and quite addictive. The game is only need you to tap on its screen to fight the monsters or the titans.

After playing the game for 2 days, I’m starting to get impatient since the gold earned is never enough to beat each new stage of monsters. So I decide to take a look on the game files and found that the game is running based on .adat save file. Most .adat file is similar to .dat file which contain HEX data or other string. In Tap Titans it contains JSON data and some unique encryption.

This mod progress can work on both Android and iOS version, only the file name that’s a bit different. There are several tools you need to mod the save file:

  • 010 Editor by Sweetscape.
  • Encryption Script used to encrypt the sha-1 key. Copy the script below to a new file and name it encrypt.1sc ( it’s a 010 Editor script )

//010 Encryption script
//--------------------------------------
//--- 010 Editor v3.2 Script File
//
// File: encrypt
// Author: cynosure
// Revision: 1.0.7
// Purpose: tap titans sha-1 checksum savefile encryption
//--------------------------------------
byte key[9];
key[0]=7; key[1]=3; key[2]=2; key[3]=5; key[4]=4; key[5]=2; key[6]=5; key[7]=5; key[8]=3;
int actfile = GetFileNum();
int newfile = FileNew();
FileSelect(actfile);
int siz = FileSize();
int place = 0; int addr = 0; int out = 0; uint data = 0;
while(addr < siz){
FileSelect(actfile);
data = ReadByte(addr++);
FileSelect(newfile);
WriteByte(out, (data + key[out %9]) );
out++;
}
  • Next is the decrypt code which is optional, only if you want to check the sha-1 key encryption

//010 Decryption script
//--------------------------------------
//--- 010 Editor v3.2 Script File
//
// File: decrypt
// Author: cynosure
// Revision: 1.0.7
// Purpose: tap titans sha-1 checksum savefile decryption
//--------------------------------------
byte key[9];
key[0]=7; key[1]=3; key[2]=2; key[3]=5; key[4]=4; key[5]=2; key[6]=5; key[7]=5; key[8]=3;
int actfile = GetFileNum();
int newfile = FileNew();
FileSelect(actfile);
int siz = FileSize();
int place = 0; int addr = 0; int out = 0; uint data = 0;
while(addr < siz){
FileSelect(actfile);
data = ReadByte(addr++);
FileSelect(newfile);
WriteByte(out, (data - key[out %9]) );
out++;
}

Before we begin to mod the save file, let’s take a look on the structure, since I did this mod on Android, I will be using Android file structure as a base in this article. You’ll find the save file in Android/data/com.gamehivecorp.taptitans

ss-taptitans-folder

there are two similar files, the .adat file and .adat.old file, the old file is used by the game as a diff checker to prevent modding on the save file. So we will need to delete this file.

Next is the filesgamedata folder will be containing a live safe if your game is running, so make sure you quit the game and remove it from task manager and empty this folder.

Copy the .adat file to your PC and we will start working on the mod using the 010 Editor. When you open the .adat file you’ll probably see some unstructured codes and hex value like in the screenshot below

ss-taptitans-adat-file-1

Hide the Hex view mode by hitting Ctrl+H, this will make editing the code become easier.

Now the part you need to edit are starting from this line

{\"playerLevel\":\"693\"... 

until the closing bracket before this

","lastUsedTexture":"....

, in my case it’s the

"firstPurchaseMsgShown\":false}

Now, the rule you need to remember when editing the JSON data is the size. The game come with a cheat prevention using Size Diff checker, in order for your mod to work you need to make sure if you add 1 character you also remove 1 character. For example, I have this line

\"playerRelics\":\"0\"

and I want to have 99 relics which means adding 1 extra character, so I need to remove another character from the file, the safest way would be to remove 1 character from the name since I can edit the name whenever I want in the game later.

So let’s change the code into

\"playerRelics\":\"9.99E+97\"

this will give you unlimited relics, since the first relic is “0” and I changed it to “9.99E+97” which mean there are 7 additional characters, I then go and remove 7 character from, so it will be

\"playerName\":\"Sword\"

from

\"playerName\":\"Sword Master\"

After editing the name, here comes the encryption part. Select and Copy the code from

{\"playerLevel\":\"693\"...

up to

"firstPurchaseMsgShown\":false}

might be different depend on yours, used the lastUsedTexture text as a base for the end. Then paste the code in the field here http://www.freeformatter.com/javascript-escape.html, we need to unescape

\"

from the JSON data.

Create a new file in 010 Editor or hit CTRL+N then copy back the unescaped string, Select all the string in this new file and hit CTRL+K, you’ll prompt to encryption window, only check for SHA-1 and hit OK

ss-taptitans-sha-1

Below your editing screen you’ll see the Checksum tab, copy and paste the value of the Checksum from SHA-1 algorithm to a new file, this time we’ll use the encryption script. Block or select all the checksum value and hit CTRL+U this will turn all the letter into lowercase which is a must, then hit F7 and run the encrypt.1sc file (you may need to open this file on the 010 editor first).

Now we have get the encrypted string, copy all this string then go to your .adat file and find lastUsedTexture string, change the value with this new one. This is the key in this save file mod, the lastUsedTexture value storing the encrypted save data to prevent cheating or modding on the save file, by doing our own encryption we pass the texture check.

Last part would be to copy the new .adat file and put it in your com.gamehivecorp.taptitans folder, just make sure you emptied filesgamedata and remove .adat.old file.

You can explore more about the save file data, and play with your own value and experience the game with much more powerful hero :D, good luck with modding the game.

If you’re interested with my save game for Tap Titans, you can download it here

Download Save File

Special thanks to SiNfuL iPhone for tap titans discussions.