DICT: Difference between revisions

From Luigi's Mansion 2 Modding Wiki
(Add Tools section)
m (Protected "DICT" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
The DICT ('''.dict''' or presumably '''dictionary''') file format is a file format used by ''Next Level Games'' to store information and lookup data for files that can be extracted from a corresponding [[DATA|.data]] file. These files contain data for textures, models and scripts, among others.
The '''DICT''' ('''.dict''' or presumably '''dictionary''') file format is a file format used by ''Next Level Games'' to store information and lookup data for files that can be extracted from a corresponding [[DATA|.data]] file. These files contain data for textures, models and scripts, among others.
 
.dict files use the little endian format.


== Layout ==
== Layout ==
Line 41: Line 43:
|The byte size of the largest compressed file stored in the .data file.
|The byte size of the largest compressed file stored in the .data file.
|-
|-
|0x10-0x2b
|0x10
|27
|1
|Unknown
|File Table Count
|
|-
|0x11
|1
|Padding
|
|-
|0x12
|1
|File Table Reference Count
|
|-
|0x13
|1
|File Extension Count
|The amount of file extensions that are present in the extracted files. These are normally .data and .debug, therefore this value most of the time is 0x2.
|}
 
=== File Table Reference Section ===
{| class="wikitable"
!Offset
!Byte Size
!Name
!Description
|-
|0x0-0x3
|4
|Hash
|
|
|-
|0x4-0xb
|8
|Indices
|An array of 8 Bytes.
|}
|}


Line 76: Line 111:
|4
|4
|Flags
|Flags
|Determines if the file is a data file or file table
|Determines if the file is a data file or file table.<ref>The exact usage of them is not fully understood currently by the author of this article. To find out more about these flags please refer to https://github.com/KillzXGaming/NextLevelLibrary/blob/master/Games/LM2/DICT_Parser.cs</ref>
The exact usage of them is not fully understood currently by the author of this article. To find out more about these flags please refer to [https://github.com/KillzXGaming/NextLevelLibrary/blob/master/Games/LM2/DICT_Parser.cs https://github.com/KillzXGaming/NextLevelLibrary/blob/master/Games/LM2/DICT_Parser.cs]
|-
|0xc
|1
|Type
|Determines the type of the file. If the byte is 0x08 it is a file table, if it is 0x80 it is a data file.
|-
|0xd
|1
|Padding
|Presumably at least, the byte is always 0.
|-
|0xe
|1
|File Extension
|Determines if the file is a .data or a .debug file. 0x0 is .data and 0x1 is .debug.
|-
|0xf
|1
|Unknown
|
|}
|}


== Tools ==
== Tools ==
These are current tools, through which the contents of a [[DATA|.data]] file can be extracted with a .dict file.
''→ Main article: [[Tools#Tools_for_DATA-DICT_extraction|Tools]]''
 
* https://github.com/MapStudioProject/CTR-Studio/releases by KillxZGaming (recommended) Most advanced tool which is able to extract the files, textures, models, as well as more.
* https://github.com/hadashisora/LM2L by hadashisora The first tool that was able to extract data from Next Level Games' file format. Is able to extract files and textures.
* https://github.com/Schweini07/LM2-Modding/tree/master/Tools/data_extractor by Schweini07 (under development) Developed as a research project, but is planned to have comparable features to CTR Studio.

Latest revision as of 16:41, 25 May 2024

The DICT (.dict or presumably dictionary) file format is a file format used by Next Level Games to store information and lookup data for files that can be extracted from a corresponding .data file. These files contain data for textures, models and scripts, among others.

.dict files use the little endian format.

Layout

A .dict file consists of a header section, a currently unknown section corresponding with the amount of files located in the .data file and multiple file sections. Typically .dict files contain information on 8 files that can be extracted from a .data file. This is not a fixed number and could differ in certain files!

Header

Offset Byte Size Name Description
0x0-0x3 4 Identifier Magic adress that identifies a .dict file. It's hex value is 0xA9F32458.
0x4-0x5 2 Header Flags Use is currently unknown. The hex always seems to be 0x0104.
0x6 1 Compression Flag If the .data file is compressed the byte is set to 0x1, else to 0x0.
0x7 1 Padding
0x8-0xb 4 File Count Number of files that are stored in the .data file.
0xc-0xf 4 Largest Compressed File The byte size of the largest compressed file stored in the .data file.
0x10 1 File Table Count
0x11 1 Padding
0x12 1 File Table Reference Count
0x13 1 File Extension Count The amount of file extensions that are present in the extracted files. These are normally .data and .debug, therefore this value most of the time is 0x2.

File Table Reference Section

Offset Byte Size Name Description
0x0-0x3 4 Hash
0x4-0xb 8 Indices An array of 8 Bytes.

Unknown Section for Extractable Files

Next is a section where one byte is allocated for every file that can be extracted from the .data file. As there are normally 8 files that can be extracted, this section typically ranges from offset 0x2c to 0x33.

File Section

For each file that can be extracted, a section with a total of 16 bytes can be found. The first section can be found at offset 0x34, assuming there are 8 files to extract.

Offset Byte Size Name Description
0x0-0x3 4 Offset Gives the offset in bytes where the file data is located in the .data file.
0x4-0x7 4 Decompressed File Size File size in bytes when decompressed.
0x8-0xb 4 Compressed File Size File size in bytes when compressed.
0xc-0xf 4 Flags Determines if the file is a data file or file table.[1]
0xc 1 Type Determines the type of the file. If the byte is 0x08 it is a file table, if it is 0x80 it is a data file.
0xd 1 Padding Presumably at least, the byte is always 0.
0xe 1 File Extension Determines if the file is a .data or a .debug file. 0x0 is .data and 0x1 is .debug.
0xf 1 Unknown

Tools

→ Main article: Tools

  1. The exact usage of them is not fully understood currently by the author of this article. To find out more about these flags please refer to https://github.com/KillzXGaming/NextLevelLibrary/blob/master/Games/LM2/DICT_Parser.cs