Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by ISKA »

Example file: https://drive.google.com/open?id=1oUJbu ... RZJO_buYbY
Game using Engine:Vicarious Visions Alchemy: https://pcgamingwiki.com/wiki/Engine:Vi ... ns_Alchemy
marvel_ultimate_alliance_2.bms script extract working but not import.
Can anyone help me ?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Crash bandicoot n trilogy .pak unpack/repack

Post by aluigi »

Regarding the script, the reason why I can't use the direct file writing instead of the memory files (a temporary buffer) is that the format uses some zeroes not available in the input (they are created in the output file), and also because files without names may be used.

I think that the script "may" work without memory files too but currently I can't test it and I don't want to ruin a working script.

If I'm not in error the reimporting of memory files work correctly most of the time, have you tried it?
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Re: Crash bandicoot n trilogy .pak unpack/repack

Post by ISKA »

aluigi wrote:Regarding the script, the reason why I can't use the direct file writing instead of the memory files (a temporary buffer) is that the format uses some zeroes not available in the input (they are created in the output file), and also because files without names may be used.

I think that the script "may" work without memory files too but currently I can't test it and I don't want to ruin a working script.

If I'm not in error the reimporting of memory files work correctly most of the time, have you tried it?


Can you show me ?
I don't understand
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by aluigi »

reimport.bat
If it works works, if it doesn't work... doesn't work :D
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by ISKA »

Code: Select all

Error: script invalid for reimporting, it uses MEMORY_FILEs
       You can use the -. option or quickbmsver "-." if this script is meant
       to act as a header/data builder (for example if it adds a RIFF header
       to raw PCM data embedded in the file, and so on), the MEMORY_FILE data
       will be skipped automatically allowing to reimport the real file data

Last script line before the error or that produced the error:
  118 log NAME 0 SIZE MEMORY_FILE


Im trying only folders import message:

Code: Select all

 offset   filesize   filename
--------------------------------------
/
- 0 files reimported in 0 seconds
- 114 files or logs left original, not available in the folder
  coverage file 0    79%   682506     856986     . offset 000cd9c8
  coverage file -1    0%   0          22501      . offset 000057e5
makc_ar
Posts: 1193
Joined: Sun Aug 17, 2014 7:27 pm

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by makc_ar »

@aluigi
Here https://www37.zippyshare.com/v/hOrfBw6u/file.html archives UNSUPPORTED folder
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by aluigi »

Based on the comment in the script I guess I can do nothing about them.
pashok6798
Posts: 14
Joined: Fri Dec 19, 2014 6:05 am

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by pashok6798 »

Could it be that some blocks are compressed and encrypted? Because I found some lzma blocks and it decompress sucessful but there is some blocks that don't have some familiar compression format and it looks like some block random bytes.
ISKA
Posts: 223
Joined: Mon Apr 09, 2018 11:09 pm

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by ISKA »

up someone help or write unpack repack tool?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by aluigi »

I have updated the script to version 0.4.

Long story short: the format MUST have a table somewhere that says if a chunk is compressed or not, that's why the script had problems with some chunks and reported the UNSUPPORTED error.
There is a table indeed but it doesn't match the files, doesn't matter how you use it since it's wrong.
The only solution was using a lame work-around that checks if a chunk is compressed or not by reading the content of the chunk itself... very lame but it works well with lzma.
I'm not going to waste other time with this crappy format...
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by LolHacksRule »

Minor bug with the script but this PAK file (from Windows ver) errors after extracting the last file.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by aluigi »

I have headache just thinking to go back working on that script :D
Apparently the problem is "math CHUNK_ZSIZE = CHUNK_SIZE" because CHUNK_SIZE is 0x00800000 while I suppose the size is about 0x27719... but it's a mess, so I prefer to stay far away from it.
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: Crash bandicoot n trilogy .pak unpack/repack [IGA marvel_ultimate_alliance_2.bms]

Post by LolHacksRule »

Dang, good on you for trying then