Twin Saga - Aeria Games - .pak

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
NXS
Posts: 2
Joined: Sat Apr 14, 2018 11:12 pm

Twin Saga - Aeria Games - .pak

Post by NXS »

Hi, I've been having a problem trying to decrypt Twin Saga files

I have an error, when decrypting I can not find the new code in the game exe and I want to see if someone with more experience can help me find it

Image

I'm using it as a base

Code: Select all

# Aeriagames pkg.idx/pkg???.pkg (script 0.1.2)
# script for QuickBMS http://quickbms.aluigi.org

comtype unzip_dynamic
getdstring DUMMY 260
getdstring SIGN 32
math PKG_OLD = -1
get FULLSIZE asize
do
    get DUMMY long
    get OFFSET long
    get DUMMY long
    get ZSIZE long
    getdstring DUMMY 0x28
    get SIZE long
    getdstring NAME2 260
    getdstring NAME 260
    get DUMMY long
    get PKG long
    get DUMMY long
    if PKG != PKG_OLD
        string PKG_NAME p= "pkg%03d.pkg" PKG
        open FDSE PKG_NAME 1
        math PKG_OLD = PKG
    endif
    string NAME += NAME2

    goto OFFSET 1
    get TMP1 byte 1
    get TMP2 byte 1
    if TMP1 == 0x88 && TMP2 == 0x1c
        savepos OFFSET 1
        math ZSIZE -= 2
    endif
    clog NAME OFFSET ZSIZE SIZE 1
    savepos CURR
while CURR < FULLSIZE


Here is the .pak and its first file of descopilarion and the game.bin
https://mega.nz/#F!4YYmjBBK!LDmkXnY7kTcUHlLxoLClNg
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Twin Saga - Aeria Games - .pak

Post by aluigi »

The homepage of quickbms is http://quickbms.com
You must EVER use the latest versions of the scripts available there, in this case:
http://aluigi.org/bms/aeriagames.bms
NXS
Posts: 2
Joined: Sat Apr 14, 2018 11:12 pm

Re: Twin Saga - Aeria Games - .pak

Post by NXS »

thank you very much do not check the official page for the post I saw this not so old, thanks for your help <3 :D
moonpaladin
Posts: 74
Joined: Wed Mar 06, 2019 12:53 pm

Re: Twin Saga - Aeria Games - .pak

Post by moonpaladin »

Hello .! I tried to decompress the Grand Fantasia game from aeriagames, the script were working without problems until reach a certain .pkg, and throw this error. I uploaded the pkg.idx and the pkg040.pkg dunno if only these files are necesary to tweak the script a bit, but hope you can give support to this game. Thanks :P

error.png


https://www.mediafire.com/file/l86olir3 ... G.zip/file
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Twin Saga - Aeria Games - .pak

Post by aluigi »

I don't know if I can do anything.
I didn't check the file but that "zlibx" compression is a sort of customization of zlib made by aeriagames.
The only thing you can try is running quickbms with the -9 option and "maybe" the crash will be ignored (still not a solution but at least...).
moonpaladin
Posts: 74
Joined: Wed Mar 06, 2019 12:53 pm

Re: Twin Saga - Aeria Games - .pak

Post by moonpaladin »

aluigi wrote:I didn't check the file but that "zlibx" compression is a sort of customization of zlib made by aeriagames.
The only thing you can try is running quickbms with the -9 option and "maybe" the crash will be ignored (still not a solution but at least...).

Hello aluigi, thanks for reply, I just tried the -9 option it extracted more files but still crashing. :cry:
Image
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Twin Saga - Aeria Games - .pak

Post by aluigi »

You can skip that file by using the following command-line option of quickbms (maybe in a .bat file):

Code: Select all

quickbms.exe -f "!new_gamedata\launcher.exe"

So extraction will go forward avoiding that crash.
moonpaladin
Posts: 74
Joined: Wed Mar 06, 2019 12:53 pm

Re: Twin Saga - Aeria Games - .pak

Post by moonpaladin »

aluigi wrote:You can skip that file by using the following command-line option of quickbms (maybe in a .bat file):

Code: Select all

quickbms.exe -f "!new_gamedata\launcher.exe"

So extraction will go forward avoiding that crash.


Hello aluigi! sorry for late response, I had tried with that exception and still getting error in other files. The only way gonna be adding them to the exception list right?. Thank you.

Code: Select all

quickbms.exe -f "!new_gamedata\launcher.exe,!new_gamedata\launcher.exe.bz2,!data\Translate\T_ElfCollect.ini"


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

Re: Twin Saga - Aeria Games - .pak

Post by aluigi »

I really don't know what to suggest you.
Manually filtering every file is impossible.
I also checked the FLAGS field but it's the same for all the files (0x20) so it doesn't seem a different algorithm or a different setting.