Castle of Illusion

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Castle of Illusion

Post by aluigi »

April Diaz
Posts: 5
Joined: Mon Jun 20, 2016 5:45 pm

Re: Castle of Illusion

Post by April Diaz »

I unpacked the resources of the game from the archive data.pak through this script http://aluigi.altervista.org/bms/castle_of_illusion.bms
How to restore the original file using only bms script and unpacked resources?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Castle of Illusion

Post by aluigi »

Do you mean reimporting the extracted and modified files back in the archive?
You can find all the explanation and the technical limitations in section 3 of quickbms.txt:
http://aluigi.org/papers/quickbms.txt
April Diaz
Posts: 5
Joined: Mon Jun 20, 2016 5:45 pm

Re: Castle of Illusion

Post by April Diaz »

I want to repack the game with maximum compression of all the resources from the archive data.pak
Maybe there is a way to create data.pak size in 1kb and then reimport the resources?
How can I get the original size data.pak bit-accurate?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Castle of Illusion

Post by aluigi »

So, basically, you want a rebuilder.
The format is not easy so I doubt someone would like to write a rebuilder from scratch and understanding ALL the fields of the format.
Additionally the format already uses compression (lz4) so you would have no big improvements if the settings of the original lz4 used by the developers are already at max.
There is even a problem with the reimport mode of quickbms that will probably give you something that is not usable by the game because lz4 doesn't have a "container" like zlib and will return an error if the compressed size is not the same of the original file (not minor, just the same).
So the script is valid for reimporting but the game will not work with the modified archive.
April Diaz
Posts: 5
Joined: Mon Jun 20, 2016 5:45 pm

Re: Castle of Illusion

Post by April Diaz »

Yes, now I understand. Definitely the game supports the container size larger than the original, because the Russian group of enthusiasts has transferred all of the resources and found a way to update the file data.pak The question is how they did it?
April Diaz
Posts: 5
Joined: Mon Jun 20, 2016 5:45 pm

Re: Castle of Illusion

Post by April Diaz »

I express my gratitude to you for detailed explanations.
Savage
Posts: 176
Joined: Thu Oct 02, 2014 4:58 pm

Re: Castle of Illusion

Post by Savage »

The game uses FSB5 for the audios (mp3 i think), you can reduce the bitrate for this FSB5 files and the game will be more smaller, you can found the FSB5 in the extracted data and the non extracted data, i think the 70% of the game are compressed audios
April Diaz
Posts: 5
Joined: Mon Jun 20, 2016 5:45 pm

Re: Castle of Illusion

Post by April Diaz »

Thanks but I'm only interested in lossless compression.