Tunshi Kongming Legends *.twkpkg

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Tunshi Kongming Legends *.twkpkg

Post by hackspeedok »

hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Tunshi Kongming Legends *.twkpkg

Post by hackspeedok »

up
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Tunshi Kongming Legends *.twkpkg

Post by aluigi »

Bad news, it uses a different 20-bytes xor key for each file but I don't know how it's generated.

The script is useless without these keys:

Code: Select all

idstring "TWKPKG\0\0"
get VER short   # 3
getdstring KEY 16
get INFO_SIZE long

filexor KEY
getdstring ZERO 0x84
get DUMMY long  # 0x12c
get DATA_SIZE long
get FILES long
get FILES long  # same
for i = 0 < FILES
    get SOME_CRC long
    get DUMMY long
next i
for i = 0 < FILES
    get SIZE long
    get OFFSET long
    getdstring DUMMY 0x158  # base64 encrypted data of 256 bytes

    # it requires a 20-bytes XOR for each file!
    log "" OFFSET SIZE
next i