BMG file format

From Sunshine Wiki
Jump to navigation Jump to search

General Info[edit | edit source]

BMG files are J2D message archives that contain text. Sunshine uses MESGbmg1 v1. In Europe+ revisions, certain BMGs were updated to include STR1 sections.

File Structure
* Header
* INF1
* DAT1
* STR1

Header Section[edit | edit source]

header is 32 bytes

Offset Type Description
0x00 string File magic "MESGbmg1"
0x08 uint32 File size in blocks (32 bytes for one block)
0x0C uint32 Section count (2 in old BMGs, 3 in updated BMGs)
0x10 bytes padding

INF1[edit | edit source]

The INF1 is the file hierarchy information. The INF1 entries depend on the BMG, with some only having 4 bytes whilst others have 12 bytes. header is 16 bytes

Header
Offset Type Description
0x00 string Section magic "INF1"
0x04 uint32 Section size
0x08 uint16 Entry count
0x0A uint16 Entry length (0x0C, aka 12 bytes, for most)
0x0C uint16 Message Archive ID
0x0E byte ???
0x0F byte ???
Entry
Offset Type Description
0x00 uint32 DAT1 entry offset
0x04 uint16 Start Frame
0x06 uint16 End Frame
0x08 uint16 STR1 entry offset (updated BMGs only)
0x08/0x0A byte Sound ID
0x09/0x0B bytes padding (3 bytes if old BMG, 1 if updated BMG)
SpaceWorld Entry
Offset Type Description
0x00 uint32 DAT1 entry offset
0x04 byte ???
0x05 byte ???
0x06 byte ???
0x07 byte ???


DAT1[edit | edit source]

DAT1 contains the text entries. header is 8 bytes

Header
Offset Type Description
0x00 string Section magic "DAT1"
0x04 uint32 Section size
Entry
Offset Type Description
0x00 byte padding
0x01 array of bytes Text

padding (if applicable) added to align file

STR1[edit | edit source]

STR1 contains strings, which essentially act as names for each text entry. It was added in certain BMGs starting with the European release although they have no purpose. header is 8 bytes

Header
Offset Type Description
0x00 string Section magic "STR1"
0x04 uint32 Section size
Entry
Offset Type Description
0x00 byte padding
0x01 string String

padding (if applicable) added to align file