Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Nintendo MSBT message file

From ReverseEngineering.wiki
Format
Vendor Nintendo
Magic 4D 73 67 53 74 64 42 6E (MsgStdBn)
Extensions .msbt
Endianness selected by the byte-order mark at 0x8 (FE FF big, FF FE little)
On this wiki Facts · Code · Notes · Topics

Message text container of Nintendo's LMS (Layout/Message Studio) library, extension .msbt, magic MsgStdBn: a 0x20-byte header with byte-order mark, encoding and version, then 16-byte-aligned blocks (LBL1 labels in a hash table, TXT2 strings, ATR1 attributes, TSY1 styles) whose strings carry inline control tags introduced by character 0x0E.

Identification

The file starts with the 8 ASCII bytes MsgStdBn. The next u16 at 0x8 is a byte-order mark: 0xFEFF means big endian, 0xFFFE little endian (so a little-endian file shows the bytes FF FE). The documentation read describes version 3 of the format. Companion files with the same container layout: MsgPrjBn (Format:Nintendo MSBP project file) and MsgFlwBn (Format:Nintendo MSBF flow file). Older Wii message tables use a different format, see Format:BMG message file.

Container (shared by MSBT, MSBP and MSBF)

Header (0x20 bytes): magic (8), byte-order mark (u16), an unknown u16 at 0xA (documented as always 0), message encoding (u8 at 0xC: 0 UTF-8, 1 UTF-16, 2 UTF-32), version number (u8 at 0xD), number of blocks (u16 at 0xE), unknown u16 at 0x10 (always 0), file size (u32 at 0x12), 10 bytes of padding. A block has a 16-byte header: block type (4 ASCII), block size without the header (u32), 8 bytes of padding; the data follows. All blocks are aligned to 16 bytes and the gaps are filled with 0xAB bytes, which is a quick way to recognise the format in a hex dump.

Blocks of an MSBT

  • LBL1: labels for the messages (and for ATR1/TSY1 entries), stored as a hash table, see below.
  • TXT2: u32 message count, one u32 offset per message, then the null-terminated strings. The offsets are measured from the start of the block data (Unverified: the documentation does not say what the offsets are relative to; check with a sample, they normally start right after the offset table).
  • ATR1: per-message attributes: u32 attribute count, u32 bytes per attribute, the attribute records, then optionally strings that attributes point into. The record layout is game specific and can be declared in the project file (Format:Nintendo MSBP project file ATI2 block).
  • TSY1: if present, one u32 style index per message into the MSBP style list.

Label hash table

A label block (LBL1 here; CLB1, ALB1 and SLB1 in MSBP use the same layout) begins with the bucket count (u32), then 8 bytes per bucket (u32 label count, u32 offset to the labels of that bucket), then the labels: a length byte, the label text without terminator, and a u32 item index. Hash: for each character, hash = hash * 0x492 + char (32-bit), the bucket is hash modulo the bucket count. Official MSBT files use 101 buckets or a smaller prime, official MSBP files 29 (observations of the documentation author).

Control tags in strings

A tag begins with character 0x0E, followed by u16 tag group id, u16 tag index, u16 size of parameters, then the parameters. Character 0x0F can close the region a tag affects; it always occupies 6 bytes regardless of the encoding and is almost never seen in official files. Group 0 (System) is predefined: tag 0 Ruby (rt string), 1 Font (face), 2 Size (percent u8, size string), 3 Color (r, g, b, a, name), 4 PageBreak (no parameters), 5 Reference (mstxt, label, lang). All other groups are game specific and are named in the TGG2/TAG2/TGP2 blocks of the project file. To translate a game, keep the 0x0E sequences byte-exact and only change the text between them.

Tools

Unverified: community editors and libraries exist for MSBT (searching for the magic MsgStdBn finds them); none was read for this page.

Code & repositories

  • https://github.com/kinnay/Nintendo-File-Formats @ b9ed426b16d04e24294f76de10f2e9b6922a9c8b · license: none
    Documentation wiki of Nintendo formats; src/libs/lms holds the MSBT, MSBP and MSBF pages. No license file was detected: the wiki cites facts only.
    Tested on: source read, not run: documentation read, nothing run · checked 2026-10-19; last activity 2026-10-11; no license: not reusable

Evidence & references

All layouts above come from the Nintendo-File-Formats wiki pages src/libs/lms/overview.md and msbt.md (see the facts attached to this page). Nothing was tested on a game file.