MSBT file

The dialogs of Super Mario Galaxy 2 is stored in .msbt files.

File header

Offset Type Description
0x00 char[8] 'MsgStdBn'
0x08 short Byte Order, 0xFEFF: Big Endian
0x0A short unknown, always 0
0x0C short unknown, always 0x0103
0x0E short unknown, always 3 (number of sections?)
0x10 short unknown, always 0
0x12 long file size
0x16 short[5] unknown, all always 0

LBL1 section

The LBL1 section contains a series of label-index pairs. The label is string that identifies a npc. If a stage for example has a luma with MessageId 3, its label would be 'Tico003' (tico is the Japanese name for a luma). The index is an index to a string in the TXT2 section.

The LBL1 section starts with a header with structure as follows.

Offset Type Description
0x00 char[4] 'LBL1'
0x04 long section size
0x08 long[2] unknown, both always 0
0x10 long number of entries

Each entry consists of two longs. The second long is an offset to a sequence of label-index pairs. The first long tells how many label-index pairs there are in that list.

For some reason there are always 101 entries, of which many often have no label-index pairs associated with them.

A label-index pair consists of a length-prefixed string (the label) and a long (the index).

ATR1 section

The ATR1 section contains a table of attributes, one set of attributes per string in the TXT2 section.

The ATR1 section starts with a header with structure as follows.

Offset Type Description
0x00 char[4] 'ATR1'
0x04 long section size
0x08 long[2] unknown, both always 0
0x10 long number of entries
0x14 long unknown, always 12 (entry size?)

An entry has the following structure.

Offset Type Description
0x00 byte unknown
0x01 byte unknown, possible values: 0,1,2
0x02 byte dialog type
0x03 byte unknown, possible values: 0,1,2,3,4,5,6,7,8
0x04 short unknown
0x06 byte unknown
0x07 byte unknown
0x08 long offset to null-terminated utf-16 string

There are four dialog types: normal (0), shout (1), dialog starts when you get close (2) and dialog starts no matter where you are (3).

The only instance where the string, to which there is an offset, is not the empty string is in MarioFaceShipZone.msbt. (TODO: insert string)

TXT2 section

The TXT2 section is a string table.

The TXT2 section starts with a header with structure as follows.

Offset Type Description
0x00 char[4] 'TXT2'
0x04 long section size
0x08 long[2] unknown, both always 0
0x10 long number of entries

Next follows a long for each entry, each of which is an offset to a null-terminated utf-16 string.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License