Godot Reverse Engineering: Recover Lost Projects and Decompile GDScript
Are you looking to recover a lost Godot game project or decompile GDScript code? Look no further! This article dives into GDRETools/gdsdecomp, a powerful suite of Godot reverse engineering tools that can help you recover projects, extract assets, and decompile GDScript.
What is GDRETools/gdsdecomp?
GDRETools/gdsdecomp is an open-source module designed to assist in reverse engineering Godot Engine projects. It provides functionalities to recover lost or inaccessible projects, extract archives, and decompile GDScript code. This tool is invaluable for developers who have lost their project files, want to analyze existing Godot games or need to extract assets from compiled games.
Key Features of Godot Reverse Engineering Tools
This module offers a range of features for Godot reverse engineering, including:
- Full project recovery: Recover project resources from PCK, APK, or EXE files.
- GDScript decompiler: Decompile GDScript back to readable source code.
- PCK archive extractor/creator: Extract or create PCK archives.
- Resource converter: Convert resources between text and binary formats.
How to Recover a Godot Project
The full project recovery feature can reconstruct your project from compiled versions. Here’s how it works:
- Loads resources: Extracts resources from PCK, APK or EXE files.
- Decompiles scripts: Converts GDScript bytecode back into human-readable code.
- Recovers project files: Rebuilds the original project structure.
- Converts resources: Transforms imported and auto-converted resources back to their original formats.
This process essentially reverses the compilation, giving you a working project from the compiled output.
Decompile GDScript using Command Line
The command line interface gives you more control, especially for batch processing. Here are some useful commands:
--recover=
: Recovers a full project from a specified file.--extract=
: Extracts contents from a PCK, APK, or EXE archive.--decompile=
: Decompiles GDScript files, supporting glob patterns for batch conversion.
Real‑world examples
Example 1: gdre_tools --headless --recover=mygame.pck --output=recovered_project
This command recovers the project from mygame.pck
and saves it to the recovered_project
directory.
Example 2: gdre_tools --headless --decompile="res://scripts/*.gdc" --bytecode=4.1.1
This command decompiles all .gdc
files in the res://scripts/
directory using the Godot 4.1.1 bytecode version.
Practical Applications of These Tools
- Lost Source Code Recovery: If you've lost your original project files due to hardware failure or accidental deletion, these tools can help you reconstruct your project from the compiled game.
- Asset Extraction: Extract textures, models, and sounds from existing Godot games for educational purposes or to create mods.
- Code Analysis: Decompile GDScript to understand how other games implement certain features or to learn new programming techniques.
- Game Modding: Extract and modify game assets to create your own unique experiences.
- Reverse engineering: Gain insights into the architecture and functionality of compiled Godot games.
Getting Started with Godot Reverse Engineering Tools
Ready to give it a try? Here’s how to get started:
- Download: Grab the latest release from the GDRETools/gdsdecomp releases page.
- Installation: Follow the instructions in the README for installing the module.
- Usage: Use the GUI or command-line tools.
Important limitations
Keep in mind that not all resource types are supported:
- Older models (
.dae
,.fbx
,.glb
for 3.x and 2.x). .obj
meshes.- Bitmap and image fonts (TTF/OTF fonts in Godot 4.x are supported).
- GDNative and GDExtension scripts.
Therefore, some manual work may be required to fully reconstruct the project.
Compile From Source
If you're comfortable with compiling from source, you can get the latest features and contribute to the project. This involves cloning the repository into Godot's modules
folder and rebuilding the engine. Instructions can be found in the official Godot documentation.
Maximize Game Development with GDRETools
GDRETools/gdsdecomp offers indispensable tools for Godot enthusiasts and developers alike. Whether recovering lost projects or reverse engineering existing ones, this module significantly boosts your capabilities. Give it a shot and discover the potential within your Godot projects.