Skip to content

feat: decompile and inject needed scripts before creating hooks - #588

Merged
KANAjetzt merged 4 commits into
GodotModding:4.x-devfrom
NanobotZ:feat-decompile-before-hooking
Aug 19, 2026
Merged

feat: decompile and inject needed scripts before creating hooks#588
KANAjetzt merged 4 commits into
GodotModding:4.x-devfrom
NanobotZ:feat-decompile-before-hooking

Conversation

@NanobotZ

@NanobotZ NanobotZ commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

Adds automatic script decompilation using GDRE, so that ModHookPreprocessor can properly load and analyze the scripts and generate valid hook code.

If game contains compressed/compiled scripts (checking for .gdc files), it works by:

  • decompiling needed scripts,
  • extracting their .remap files and fixing them (pointing from .gdc file back to .gd),
  • putting both into a zip,
  • loading the zip immediately as a resource pack (please let me know if there's an easier way for loading a script as a GDScript resource).

After hook processing, modified source together with the .remap file are packed into the mod-hooks.zip, making the game load the source properly.

I tested this using only one game (Coal LLC) with two scripts in a work-in-progress mod, additional testing might be required.

Fixes #586
Works towards #535

@kyfex-uwu

Copy link
Copy Markdown
Contributor

works for me, hooked into compiled files in Ultrapool

@KANAjetzt
KANAjetzt requested review from KANAjetzt and Qubus0 February 1, 2026 19:57
@KANAjetzt KANAjetzt added enhancement New feature or request 4.x labels Feb 1, 2026
@KANAjetzt KANAjetzt added this to the 4.x - 7.x milestone Feb 1, 2026

@KANAjetzt KANAjetzt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Great work!

I feel like it would be nice to decouple this into self setup and loader integrated. Because we only want to use GDRE in a self setup scenario.

@KANAjetzt KANAjetzt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created

to keep track of the decoupling.

@KANAjetzt
KANAjetzt merged commit 1b6e875 into GodotModding:4.x-dev Aug 19, 2026
1 check passed
@KANAjetzt KANAjetzt mentioned this pull request Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.x enhancement New feature or request self setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decompile scripts when hooking a game that has compressed scripts

3 participants