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