Lumines Puzzle Fusion / Lumines II / Lumines LIVE! .dat archive format

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
mbc07
Posts: 12
Joined: Sun Oct 13, 2019 7:19 pm

Lumines Puzzle Fusion / Lumines II / Lumines LIVE! .dat archive format

Post by mbc07 »

I made a BMS script for unpacking .dat files from Lumines Puzzle Fusion / Lumines II / Lumines LIVE!. The format is super simple and there's no magic bytes to detect the file type, so if the script doesn't run properly make sure the input files are valid .dat archives from those games.

Code: Select all

# Lumines Puzzle Fusion / Lumines II / Lumines LIVE! .dat unpacker
#
# Written by mbc07 on November 7, 2020
# Last updated on November 9, 2020 (v1.1)

Get TOTAL_SIZE asize
SavePos OFFSET

For
    # Sanity check
    If OFFSET >= TOTAL_SIZE
        CleanExit
    EndIf

    Get HEADER_SIZE short
    Endian guess16 HEADER_SIZE

    # Another sanity check
    If HEADER_SIZE <= 0
        CleanExit
    EndIf

    # Parse header
    Get PATH_SIZE short
    Get UNKNOW1 long    # Always 0x1 or 0x10001
    Get UNKNOW2 long    # Always 0x0
    Get FILE_SIZE long
    GetDString FILE_PATH PATH_SIZE

    # Extract file
    Math OFFSET + HEADER_SIZE
    Log FILE_PATH OFFSET FILE_SIZE

    # Advance and repeat
    Math OFFSET + FILE_SIZE
    GoTo OFFSET
Next