Mahjong Fight Club (PsVita - files .PAK / IdString PACK)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Solstice
Posts: 3
Joined: Fri Mar 13, 2020 7:31 pm

Mahjong Fight Club (PsVita - files .PAK / IdString PACK)

Post by Solstice »

Hello there,

I'd like to translate a PsVita Riichi Mahjong Japanese game to English, assets are in .PAK extensions, IdString are PACK.

To be honest I don't know if I'll be able to do anything serious because I'm a real newbie, but I'd like to give it a try, the work to accomplish is very interesting and require multiples skills.

Ok, here what I've been able to find so far.

-------------------------------------------------------

- Get pfs unencrypted games files (thanks vitashell, vita masterpiece software).
- Analyse "ranking.pak" files with hex editor, sorry for my newbie vocabulary and my noscript skills, I'm just writing what I've found :

IdString (PACK)
short unknown
short filenumber
long End of filename list - offset
long Beginning of filename list - offset
long End of header / Beginning of files - offset
long End of archive - offset
long End of archive - offset
long Null
Descriptor File 1 - size 32 : header TEXI - null - filesize - beggining file offset - unknown - null - filesize again - beggining file offset again
Descriptor File 2 - size 32 : header TEXI - null - filesize - beggining file offset - unknown - null - filesize again - beggining file offset again
Descriptor File 3 - size 32 : header TEX - null - filesize - beggining file offset - unknown - null - filesize again - beggining file offset again
Descriptor File 4 - size 32 : header TEX - null - filesize - beggining file offset - unknown - null - filesize again - beggining file offset again
Filenames
Filenames offset position
File 1
File 2
File 3
File 4
End of file
Solstice
Posts: 3
Joined: Fri Mar 13, 2020 7:31 pm

Re: Mahjong Fight Club (PsVita - files .PAK / IdString PACK)

Post by Solstice »

I made a script, I can browse all the game files in MultiEx, I can extract some (and those files are working as expected), but I have extraction errors with others files, it's not perfect.

-------------------------------

Code: Select all

IDString 0 "PACK" ;
Get Unknown Int 0 ;
Get Filenumber Int 0 ;
Get Filename_position_offset Long 0 ;
Get Filename_string_offset Long 0 ;
Get Files_begin_offset Long 0 ;
Get Endfile_offset Long 0 ;
Get Endfile_offset Long 0 ;
Get Null Long 0 ;

For T = 1 To Filenumber ;
    Get Filetype Long 0;
    Get Null Long 0 ;
    SavePos FSO 0 ;
    Get SIZE Long 0 ;
    SavePos FOO 0 ;
    Get OFFSET Long 0 ;
    Get Unknown Long 0;
    Get Unknown Long 0;
    Get Unknown Long 0;
    Get Unknown Long 0;
    SavePos Tmp 0 ;
    GoTo Filename_position_offset 0 ;
    Get Filename_position Long 0;
    Math Filename_position += Filename_string_offset ;
    GoTo Filename_position 0 ;
    GetDString NAME 100 0 ;
    Math Filename_position_offset += 4 ;
    Log NAME OFFSET SIZE FOO FSO ;
    GoTo Tmp 0 ;
Next T ;

-------------------------------



Problems are :
- I have multiple files with the same name (because of same values in Filename_position_offset)
- Some files are 0 byte size (in "konami_logo.pak") and return error when extracting (sound logic), why creating 0 byte size file ?
- Some files returns error when extracting them (in "menu_mode_select.pak", uploaded in this post) : Corrupted file info! 1331392> 1148544 (?).

I've probably made some errors, but I'm not able to found them yet.

Any help would be welcome, thank you.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Mahjong Fight Club (PsVita - files .PAK / IdString PACK)

Post by aluigi »

http://aluigi.org/bms/mahjong_fight_club.bms

They are not really duplicate, I guess it's something related to additional data.
For example the original is SERI and the new one is GXT.
For such reason I created a new folder called "append" for containing this additional data.
Solstice
Posts: 3
Joined: Fri Mar 13, 2020 7:31 pm

Re: Mahjong Fight Club (PsVita - files .PAK / IdString PACK)

Post by Solstice »

Thank you very much Aluigi :D