-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace GML decompiler with Underanalyzer #1862
Open
colinator27
wants to merge
44
commits into
master
Choose a base branch
from
underanalyzer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also updates a variable type in Deltarune's builtin JSON
Download the artifacts for this pull request here: GUI:
CLI: |
Requesting this to be included asap as many games fail with main, which this branch solves |
Unfortunately, that's not how reviewing works. |
This comment has been minimized.
This comment has been minimized.
Remove struct keyword
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Removes the current GML decompiler included with UndertaleModTool, replacing it with calls to the Underanalyzer library. This is intended to drastically improve accuracy and stability on valid GML bytecode. This also provides decompiler settings, which can be tailored per user, and in theory, be used to prevent C# scripts that depend on exact decompiler output from breaking in the future.
C# scripts have been updated to account for the change in decompiler. Most should be fully functional, but could use some additional stability testing.
The built-in GML code corrections have all been removed, as the decompiler is accurate enough to supersede them. Support for code corrections has not been removed, so they will still function as normal if re-added.
Some small GML compiler upgrades have been made to complement the decompiler improvements, including function constructor support, default argument values, enum support, CSS hex color literals, named instance IDs,
throw
,new
, amongst some other control flow fixes. Syntax highlighting in the code editor has been adjusted as well.External JSON game-specific data is now supported through this PR, which currently is only used for Underanalyzer type definition files. Features related to these can be expanded on in the future, after this PR.
This PR also completes support for bytecode changes observed in GameMaker 2024.6, which also updates the assembly syntax, adding
[function]
and[variable]
.A few other miscellaneous fixes and changes were made, such as some optimization/cleanup in assembly parsing, and removing extra arguments to
EventHandlerFor
(simplifying its usage).Caveats
Automatic type inference support is not present in the Underanalyzer decompiler as of right now, but it's probably something we can live without, as external JSON type definitions are now supported through this PR.
Some partially corrupt code may no longer decompile properly, but this should not be an issue, as we are not going to target any obfuscation techniques, and any other cases (e.g. manual assembly editing) are rare.
Currently, Underanalyzer is included as a submodule. We may want to switch to a different method in the future (e.g. using NuGet).
Notes
This code will be under review alongside Underanalyzer's library itself.
This branch has been under active testing by multiple users for a number of weeks, and stability seems good right now.