Game code: Difference between revisions
Fieryhenry (talk | contribs) remove some external links |
Fieryhenry (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 3: | Line 3: | ||
== Pre 7.0.0 == | == Pre 7.0.0 == | ||
In game versions older than 7.0.0, virtually all of the game code was written in Java in the .dex files in the root directory of the APK, and only containing a few bits of compiled code in the <code>lib</code> directory of the APK. | In game versions older than 7.0.0, virtually all of the game code was written in Java in the [[.dex files]] in the root directory of the APK, and only containing a few bits of compiled code in the <code>lib</code> directory of the APK. | ||
The code can be disassembled easily with a tool such as [[JADX]], hooked easily with [[Frida scripting|Frida]], and modified using [[Smali injection|smali injection]]. | The code can be disassembled easily with a tool such as [[JADX]], hooked easily with [[Frida scripting|Frida]], and modified using [[Smali injection|smali injection]]. | ||
| Line 9: | Line 9: | ||
== Post 6.10.0 == | == Post 6.10.0 == | ||
In game versions after 6.10.0, virtually all of the game code is written in c++ and compiled into a native library called <code>libnative-lib.so</code>. | In game versions after 6.10.0, virtually all of the game code is written in c++ and compiled into a [[native library]] called <code>libnative-lib.so</code>. | ||
Decompiling compiled code is much harder than Java code, and requires the use of reverse engineering tools such as [[Ghidra]]. | Decompiling compiled code is much harder than Java code, and requires the use of reverse engineering tools such as [[Ghidra]]. | ||
Latest revision as of 19:27, 5 September 2025
The form of the game code in The Battle Cats has changed a few times over the game's lifetime.
Pre 7.0.0
In game versions older than 7.0.0, virtually all of the game code was written in Java in the .dex files in the root directory of the APK, and only containing a few bits of compiled code in the lib directory of the APK.
The code can be disassembled easily with a tool such as JADX, hooked easily with Frida, and modified using smali injection.
Post 6.10.0
In game versions after 6.10.0, virtually all of the game code is written in c++ and compiled into a native library called libnative-lib.so.
Decompiling compiled code is much harder than Java code, and requires the use of reverse engineering tools such as Ghidra.
Pre 8.5.0
In game versions after 6.10.0 and before 8.5.0, there are some debug symbols still left in the binary, this makes it much easier to reverse engineer since all of the function names and class names are present. However struct layouts, enums, and the logic inside a function is still not provided.
This also means that Frida scripting is easier since the name of the function you want to hook can be used, instead of its address.
Post 8.4.0
After version 8.4.0, these debug symbols were stripped from the binary, making it much harder to reverse engineer and mod in general. The addresses of functions have to be worked out and manually specified for each game version when hooking the function.
However, since the game makes references to some libraries such as Botan, those debug symbols are still intact and can be used to help in reversing cryptographic related functions as well as hooking verification functions to force the game to verify fake HTTP responses.