A tool for unpacking, decompiling and modding GameMaker games such as Undertale or Deltarune.
- Parsing and building data files is ~8x faster than UndertaleModLib.
- Clean and maintainable library code.
- Thorough documentation on docs.rs.
- Configurable lenient options for trying to parse half-broken data files (see
ParsingOptions). - Helpful error messages:
- No
NullReferenceException, ever!!! - No meaningless stack traces over 50 lines long.
- Still more information than just "Reading out of bounds".
- Strict data integrity checks catch errors earlier, making debugging easier.
- No
This is an example error trace printed out using error.chain():
sprite::swf::item::shape::style_group::fill::gradient::Record count 1065353216 implies data size 8.5 GB which exceeds failsafe size 10.0 MB
> while reading simple list
> while deserializing element 1/2 of sprite::swf::item::shape::style_group::StyleGroup<sprite::swf::item::subshape::Data> simple list
> while deserializing element 0/1 of sprite::swf::item::Item simple list
> while deserializing element 3/60 of Sprite pointer list
> while deserializing chunk 'SPRT'
> while parsing GameMaker data file ./gm48_datafiles/a-loop_detective.win
- GML Decompiler and Compiler not yet implemented. (Help would be greatly appreciated!)
- No edtior GUI yet, only a Rust library.
Add this line in the [dependencies] section of your Cargo.toml file:
libgm = "0.6"Or if you want bleeding edge (might be unstable):
libgm = { git = "https://codeberg.org/BioTomateDE/LibGM" }Example usage is specified in docs.rs.
| Feature | Default | Dependencies |
|---|---|---|
| catch-panic | enabled | |
| check-integrity | enabled | |
| bzip2-image | enabled | bzip2 |
| png-image | enabled | image/png |
catch-paniccatches panics in GameMaker (de)serialization functions and returns them as a LibGM error.check-integrityenables alignment and constant validation while parsing. These checks may still be demoted to a warning usingParsingOptions. Some checks regarding panic safety or memory allocation are always enabled.bzip2-imageenables (de)serialization of BZip2+QOI encoded texture pages. If you try to change the format of aGMImagethat stores BZip2-QOI data with this feature disabled, an error will be returned.png-imageenables PNG (de)serialization. In games older than GM 2022.2, you will not be able to serializeGMImages storingDynamicImages with this feature disabled.
Huge thanks to the Underminers Team! Without UndertaleModTool, this project would've been impossible. I also want to thank the people in the Underminers Discord Guild who helped me along the way, especially @colinator27.
This project is licenced under the GNU Public License v3.0. SPDX-License-Identifier: GPL-3.0-only.
This means that all projects using this library must also be licensed under GPL-3 to protect the Open Source Community.
All contributions are welcome! Whether that's a pull request, a feature you would like to see added, a bug you found; just create an Issue/PR in this repo. For more information, see the contributing guidelines.
- Everything related to GameMaker is located in
libgm/src/wad/. - A disassembler and assembler are available in
libgm/src/gml/assembly/. - The highly desired
Instructiontype is inlibgm/src/gml/instruction.rs. - There is a basic CLI to interact with LibGM in
libgm-cli/src/.
You must supply your own copy of specific versions of the games. For instance, run the following commands (from the project root) to copy from your Steam library folder, where applicable:
# Linux:
export STEAM="~/.steam/steam/steamapps/common"
# macOS:
export STEAM="~/Library/Application Support/Steam/steamapps/common"
# Windows (PowerShell):
$STEAM="C:/Program Files (x86)/Steam/steamapps/common"
# For Undertale:
cp $STEAM/Undertale/data.win libgm-cli/datafiles/undertaleXXX.win
# XXX needs to be the version: 100 for 1.00 | 101 for 1.001 | 108 for 1.08
# For Deltarune Chapters 1-4
cp $STEAM/DELTARUNE/data.win libgm-cli/resources/deltarune-launcher.win
cp $STEAM/DELTARUNE/chapter1_windows/data.win libgm-cli/resources/deltarune1.win
cp $STEAM/DELTARUNE/chapter2_windows/data.win libgm-cli/resources/deltarune2.win
cp $STEAM/DELTARUNE/chapter3_windows/data.win libgm-cli/resources/deltarune3.win
cp $STEAM/DELTARUNE/chapter4_windows/data.win libgm-cli/resources/deltarune4.winTesting for Undertale 1.0.8 is gated behind the test-undertale-XXX feature (where XXX is the UT Version).
Deltarune Chapters 1-4 (v1.0.4) by test-deltarune-ch1234.
For example, if you have copied both in, run:
cargo t -plibgm-cli --features test-undertale-XXX,test-deltarune-ch1234