error when unpacking grand fantasia Ignite private server

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
beginner explorer
Posts: 3
Joined: Mon Apr 01, 2019 10:47 am

error when unpacking grand fantasia Ignite private server

Post by beginner explorer »

hello I'm sorry for my poor English haha :roll:

when trying to unpack pkg.idx using aeriagames.bms I have received several errors, I place an attachment:

- open input file C:\bms\IN\pkg.idx
- open script C:\bms\aeriagames.bms
- set output folder C:\bms\OUT

offset filesize filename
--------------------------------------
- enter in folder C:\bms\IN
- open input file C:\bms\IN\pkg2086894861.pkg
38a53630 1235360758 FItr\BQ eԤ\+edpBPO_^FWˍؑ

- it's not possible to create that file due to its filename or related
incompatibilities (for example already exists a folder with that name), so
now you must choose a new filename for saving it.
if you press ENTER a new name will be generated automatically.
- old: FItr\BQ eԤ\+edpBPO_^FWˍؑ
- new: 12345

Error: incomplete input file 1: C:\bms\IN\pkg2086894861.pkg
Can't read 524288 bytes from offset 38a53630.
Anyway don't worry, it's possible that the BMS script has been written
to exit in this way if it's reached the end of the archive so check it
or contact its author or verify that all the files have been extracted.
Please check the following coverage information to know if it's ok.

coverage file 1 0% 0 10388310 . offset 38a53630

Last script line before the error or that produced the error:
47 clog NAME OFFSET ZSIZE SIZE 1

Press ENTER or close the window to quit


he noticed that the game files are not encrypted, when extracting them not from pkg.idx but from pkg001.pkg etc. with unzip there is no problem, simply that the original names can not be recovered.

and a small sample of pkg.idx

With Aeria's grand fantasia, I had no problems. :?
Last edited by beginner explorer on Wed Apr 03, 2019 7:38 pm, edited 2 times in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: error when unpacking grand fantasia Ignite private server

Post by aluigi »

I suspect it's a sort of simple xor obfuscation applied to each entry.
The key can't be fully retrieved from the idx file because it doesn't have a fixed length, I bet it's probably seed-based so instead of having an hardcoded key of N bytes you have a sort of cycle that generates it.

The good news is that even without reverse engineering it's possible to find most of the bytes of the pre-calculated key but not possible to support the filenames.

I don't know if the data files are encrypted too, if yes then you can extract nothing without the algorithm.

In any case it's necessary to upload the whole pkg.idx file.
The game executable may be useful too.
beginner explorer
Posts: 3
Joined: Mon Apr 01, 2019 10:47 am

Re: error when unpacking grand fantasia Ignite private server

Post by beginner explorer »

aluigi wrote:I suspect it's a sort of simple xor obfuscation applied to each entry.
The key can't be fully retrieved from the idx file because it doesn't have a fixed length, I bet it's probably seed-based so instead of having an hardcoded key of N bytes you have a sort of cycle that generates it.

The good news is that even without reverse engineering it's possible to find most of the bytes of the pre-calculated key but not possible to support the filenames.

I don't know if the data files are encrypted too, if yes then you can extract nothing without the algorithm.

In any case it's necessary to upload the whole pkg.idx file.
The game executable may be useful too.



Thank you very much for responding so quickly. :)
I upload the complete pkg.idx file and the executable.

Executable:
https://mega.nz/#!clJyEaiS!5mwzwxl6arwY8rKTr8BbiKAgayhe6HDX8JOQkZd9qgA

pkg.idx:
https://mega.nz/#!kg5iCYZA!i4J-qqWhn-YNFXB6NRDSLbVI377y7QzZTAs1tsf1yDI
beginner explorer
Posts: 3
Joined: Mon Apr 01, 2019 10:47 am

Re: error when unpacking grand fantasia Ignite private server

Post by beginner explorer »

In case I discovered the algorithm, what parameters should I use? Do I have to create another bms script? I just want to know that, thanks. :?:

something I found curious: