A crate that allows manipulating Nintendo's proprietary MSBT format, with a library crate to parse those files.
MSBTools has 4 different modes of operation:
This command converts an MSBT to TOML.
Usage:
msbtool extract file.msbt
This creates a "file.toml" file next to the executable, containing all the strings in the MSBT file ordered by internal index.
This command converts a TOML to an MSBT file.
Usage:
msbtool create file.toml
This creates a "file.msbt" file next to the executable, containing all the strings in the TOML file.
This command creates a diff file between an MSBT file and multiple others.
Usage:
msbtool diff original.msbt edited1.msbt edited2.msbt ...
This creates a "original.msbd.txt" file next to the executable, containing the differences between the original file and all the edited files.
This command patches an MSBT file using a file formatted in the msbd format.
Usage:
msbtool patch original.msbt diff.msbd.txt
This creates a new MSBT file, named after the patch name found in the msbd file, with all the modifications specified by said msbd file.
MSBTool comes with its own diff format, made specifically for MSBT files. It is specified as:
[File Name]
[Patch name]
[SHA256 of the original file] (optional)
[+/-/~][label]
>[text]
>...
[+/-/~][label]
>[text]
>...
...
Each diff block being specified as:
- A state. Can be '+' for a new string, '-' for a deleted string, or '~' for an edited string.
- A label. Specifies the label of the string to add, delete or edit.
- A string. Specifies what the new string is. Deleted strings do not have this block.
Control codes have been escaped, for ease of use. For now, only one syntax is available, [RawCmd Group.Type Argument1_Argument2_etc...]
. For instance, changing the text's colour would be [RawCmd 0.3 RR_GG_BB_AA]
.
To close a control code, simply type [/RawCmd Group.Type]
.
For ease of use, certain characters have been escaped. To use them, type [!Escape_code]
. For the 3DS's A button, for instance, you'd type [!A_button_3DS]
.
The characters are as follow: