A Java-based tool for decrypting and encrypting compact.sqlite files used in certain game versions.
The compact.sqlite file is actually an encrypted ZIP archive containing binary database files.
Decryption support for 3 encryption types:
v2- Game versions 2.x up to 3.0.0.3v3- Game versions starting from 3.1.xv4- AAFree & AAClassic game versions
Encryption support: Currently only v2.
AES key calculation - Derive AES keys bit when correct key/IV constants are provided.
RSA key formatting - Format and clean up RSA keys from rsa_keys.txt file.
The compact.sqlite file is not a genuine SQLite database, but an encrypted ZIP archive containing:
- Localization binary database files
- Data binary database files
- v3 encryption support
- v4 encryption support
All files must be in the program folder.
- DB file:
compact.sqlite; - JSON config like:
config_2017_trion.json; - RSA keys parts:
rsa_keys.txt(optional).
{
"provider": "Trion",
"version": "2.0.1.7",
"aes_first_stage": {
"key_constant": "HEX",
"iv_constant": "HEX",
"key_bit": 128
},
"aes_second_stage": {
"key_constant": "HEX",
"iv_constant": "HEX",
"key_bit": 256
},
"cipher_mode": "DECRYPT"
}where:
provider- localization providerversion- game versionaes_first_stage.key_constant- 8 length HEXaes_first_stage.iv_constant- 8 length HEXaes_first_stage.key_bit- AES key bit (128, 192, 256)cipher_mode- cipher mode
DECRYPT- uses for decryptionENCRYPT- uses for encryption
{
"provider": "Kakao",
"version": "10.8.1.0",
"pirate": false,
"aes_first_stage": {
"key_constant": "HEX",
"iv_constant": "HEX",
"key_bit": 256
},
"rsa": {
"d": "HEX",
"n": "HEX",
"offset_constant": "HEX",
"parts": 10,
"c_length": "HEX",
"m_length": "HEX"
},
"aes_second_stage": {
"key_constant": "HEX",
"iv_constant": "HEX",
"key_bit": 192
},
"cipher_mode": "DECRYPT"
}where:
pirate- is AAFree or AAClassic client (required for AAFree & AAClassic versions, optionals for officials)rsa.d- private exponent in HEX ("00"if pirate)rsa.n- modulus in HEX ("00"if pirate)rsa.offset_constant- 8 length HEXrsa.parts- RSA partsrsa.c_length- 2 length HEX encrypted data lengthrsa.m_length- 2 length HEX decrypted data length (always less thanc_length)
23FFh
0BE3Eh
1291h
-
36B7h
28DCh
9AEEh
- Open
x2game.dllin IDA - Search string:
game_%u.sqlite3 - Jump to xref to operand... (
Xpress) - Copy current function name (like
sub_39935810) - Open script
ida/dump_func.py - Change
function_nametext in170line - Save it to any game folder (for convenience)
- IDA -> File -> Script file -> Select
dump_func.py - Wait for the execution and creation of the
db_function_tree.txtfile wherex2game.dllpresent - Place
db_function_tree.txtin the program folder
Note: function from step 3
This tool is intended for educational purposes.
Users are responsible for complying with applicable laws and terms of service. The developers are not responsible for any misuse of this software.




