Wario Land The Shake Dimension (WII)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Wario Land The Shake Dimension (WII)

Post by CriticalError »

Hello guys, well I come here to ask for small help about this game, really I have a script and unpack some files, but when try unpack other files I got this small issue, maybe somebody can take a look into files?

Format: GFA

# script for QuickBMS http://aluigi.org/papers.htm#quickbms
# Wario Land

Endian little

# Main header
IDString "GFAC"
Get HEADER_1_1 long
Get HEADER_1_2 long
If HEADER_1_1 != 1
Print "Strange HEADER_1_1 = %HEADER_1_1%, may crash..."
EndIf
If HEADER_1_2 != 1
Print "Strange HEADER_1_2 = %HEADER_1_2%, may crash..."
EndIf
Get FILE_TABLE_OFFSET long
Get FILE_TABLE_SIZE long
Get DATA_OFFSET long
Get DATA_SIZE long

# Read compressed data header
GoTo DATA_OFFSET

IDString "GFCP"
Get HEADER_1_1 long
Get CTYPE long
If HEADER_1_1 != 1
Print "Strange GFCP HEADER_1_1 = %HEADER_1_1%, may crash..."
EndIf
If CTYPE == 1
ComType bpe
ElseIf CTYPE == 2
ComType lz77wii_raw30
Else
Print "Unknown compression %CTYPE%"
Exit
EndIf

Get RAW_DATA_SIZE long
Get COMPRESSED_DATA_SIZE long

Set CDATA_OFFSET DATA_OFFSET
Math CDATA_OFFSET + 0x14

# Decompress
Clog MEMORY_FILE CDATA_OFFSET COMPRESSED_DATA_SIZE RAW_DATA_SIZE

# Extract files
GoTo FILE_TABLE_OFFSET
Get FILE_COUNT long
SavePos READ_OFFSET

For I = 0 < FILE_COUNT
GoTo READ_OFFSET

# Read the file entry
Get CRC32 long # guess
Get NAME_OFFSET long
Get FILE_SIZE long
Get FILE_OFFSET long

SavePos READ_OFFSET

Math FILE_OFFSET - DATA_OFFSET

GoTo NAME_OFFSET
Get FILE_NAME string

Log FILE_NAME FILE_OFFSET FILE_SIZE MEMORY_FILE
Next I


https://cloud.mail.ru/public/c264c2cee688/__PACK__.gfa

and here I attach other samples from other game, use same format, is Kirby Epic Yarn, many thanks guys.

https://cloud.mail.ru/public/1e747f2cb3 ... amples.zip
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wario Land The Shake Dimension (WII)

Post by aluigi »

Try adding "math NAME_OFFSET &= 0x7fffffff" before "GoTo NAME_OFFSET".
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Re: Wario Land The Shake Dimension (WII)

Post by CriticalError »

aluigi wrote:Try adding "math NAME_OFFSET &= 0x7fffffff" before "GoTo NAME_OFFSET".
well many thanks for try but I got this error now.

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

Re: Wario Land The Shake Dimension (WII)

Post by aluigi »

BOSS090.gfa wasn't included in the samples you uploaded.
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Re: Wario Land The Shake Dimension (WII)

Post by CriticalError »

ok here I upload couple of files, from this 2 games, here we go, thanks luigi.

Code: Select all

https://cloud.mail.ru/public/62ab5d323cf9/Wario%20Land%20Player%20gfa%20(Samples).7z
https://cloud.mail.ru/public/84c53cf474dd/Kirby%20Epic%20Yarn%20boss%20gaf%20(Samples).7z
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wario Land The Shake Dimension (WII)

Post by aluigi »

The good news is that it's not a problem of quickbms.
The bad news is that I don't know how to decompress these chunks.

In fact most of the files use an unique compressed file-system and the script works, but other files don't.
Take the file BOSS07_BULLET04.gfa, the compressed file-system starts from offset 0x94 but from offset 0x181c it's no longer compressed, in fact with bpe you can decompress the first 0x1788 bytes without problems.
I thought it was chunked data but that's not possible because there are no chunk_sizes in the archive.