BMG files

From WiiBrew
Jump to navigation Jump to search

Stores strings used in games for localization. Can be found in many first-party games.

The file structure is composed by a header and sections. The essential sections are INF and DAT. The MID section can also be found on Wii Fit Plus disc, and it is probably for message IDs.

Wiimms SZS Tools can encode and decode BMGs.

The endianess is big endian. The Nintendo DS uses little endian.

BMG header

The header is 32 bytes long. Here's a description of it:

Offset Size Description
0x0000 4 "MESG" (0x4D455347)
0x0004 4 "bmg1" (0x626D6731)
0x0008 4 File size
0x000C 4 Number of sections
0x0010 1 Encoding: 1=CP1252, 2=UTF-16/be, 3=Shift-JIS, 4=UTF-8
0x0011 15 Padding?

INF section

It comes just after the BMG header. It contains information (like pointers) about the messages.

INF header

Offset Size Description
0x0000 4 "INF1" (0x494E4631)
0x0004 4 Size of this section (bytes from section beginning)
0x0008 2 Number of messages
0x000A 2 Size of each INF data (bytes)
0x000C 4 Padding?

INF data

For each message, there is a INF data about it. At Wii Fit, there is just the message offset. At Wii Fit Plus, there is two another fields.

Offset Size Description
0x0000 4 Offset to the message (after DAT section header)
0x0004 4 Some flags? (0x00640000 seems to be "normal messages", 0x006E0000 for "menu choices" ...)
0x0008 4 ?

DAT section

It contains just header and the messages themselves.

Offset Size Description
0x0000 4 "DAT1" (0x44415431)
0x0004 4 Section size (bytes from section beginning)
0x0008 - Messages

MID section

This section is probably message IDs. There appears to be one for each message and these can presumably be used by the wii to identify each message.

Offset Size Description
0x0000 4 "MID1" (0x4D494431)
0x0004 4 Section size (bytes from section beginning)
0x0008 2 Number of entries
0x000A 2 ?
0x000C 4 Padding?
0x0010 4 Entry #1
0x0014 4 Entry #2
... 4 Entry #...

Other sources