Ghidra extension for exporting relocatable object files
Assembly
606
215 commits
updated Jun 24, 2026
This Ghidra extension enables exporting parts of a program as object files. These object files have valid metadata (symbols, relocation tables…) and as such can be reused directly by a toolchain for further processing.
Use-cases include:
Matrix of supported instruction set architectures and object files:
| x86 | x86_64 | MIPS | |
|---|---|---|---|
| COFF | ✅ | ✅ | ❌ |
| ELF | ✅ | ✅ | ✅ |
| OMF | ✅ | ❌ | ❌ |
GHIDRA_INSTALL_DIR environment variable to point to your Ghidra installation directory ;gradle buildExtension.The Ghidra extension archive will be created inside the dist/ directory.
[!NOTE] GitHub Maven repositories require authentication to download packages, you must either:
- Create a GitHub classic token with the
read:packagesright, then addgithubToken=ghp_xxxto${GRADLE_USER_HOME}/gradle.properties(usually defaults to~/.gradle/gradle.properties).- Run
gradle installStandaloneDepsto build and install vendored dependencies from submodules.
The reconstructed relocations can be viewed with Window > Relocation table (synthesized). Detailed evaluation reports can be enabled by setting the Evaluation report policy option for the Relocation table synthesizer analyzer in the Analysis > Auto Analyze... dialog.
[!TIP] You do not need to reverse-engineer the entire program upfront before using this extension. In general, successful delinking mostly depends on the following metadata inside of the subset you're exporting (and its external references):
- functions/pointers as relocation locations ;
- symbol footprints as relocation targets ;
- references between the two.
[!WARNING] The relocation table synthesizer analyzer relies on the accuracy of the Ghidra database. Incorrect or missing information may lead to broken or missed relocations during the analysis.
[!CAUTION] The object file exporters rely on the results of the relocation table synthesizer analyzer. When in doubt, run this analyzer right before exporting an object file to make sure the relocation table contents are up-to-date.
Object files are made of three parts:
When a linker is invoked to generate an executable from a bunch of object files, it will:
Normally, the relocation table is discarded after this process, as well as the symbol table if debugging symbols aren't kept, leaving only the un-relocatable section bytes. However, through careful analysis this data can be recreated, which allows us to then effectively delink the program back into object files.
Assembly
93.9%
Java
5.6%
Ghidra extension for exporting relocatable object files
Assembly
606
215 commits
updated Jun 24, 2026
This Ghidra extension enables exporting parts of a program as object files. These object files have valid metadata (symbols, relocation tables…) and as such can be reused directly by a toolchain for further processing.
Use-cases include:
Matrix of supported instruction set architectures and object files:
| x86 | x86_64 | MIPS | |
|---|---|---|---|
| COFF | ✅ | ✅ | ❌ |
| ELF | ✅ | ✅ | ✅ |
| OMF | ✅ | ❌ | ❌ |
GHIDRA_INSTALL_DIR environment variable to point to your Ghidra installation directory ;gradle buildExtension.The Ghidra extension archive will be created inside the dist/ directory.
[!NOTE] GitHub Maven repositories require authentication to download packages, you must either:
- Create a GitHub classic token with the
read:packagesright, then addgithubToken=ghp_xxxto${GRADLE_USER_HOME}/gradle.properties(usually defaults to~/.gradle/gradle.properties).- Run
gradle installStandaloneDepsto build and install vendored dependencies from submodules.
The reconstructed relocations can be viewed with Window > Relocation table (synthesized). Detailed evaluation reports can be enabled by setting the Evaluation report policy option for the Relocation table synthesizer analyzer in the Analysis > Auto Analyze... dialog.
[!TIP] You do not need to reverse-engineer the entire program upfront before using this extension. In general, successful delinking mostly depends on the following metadata inside of the subset you're exporting (and its external references):
- functions/pointers as relocation locations ;
- symbol footprints as relocation targets ;
- references between the two.
[!WARNING] The relocation table synthesizer analyzer relies on the accuracy of the Ghidra database. Incorrect or missing information may lead to broken or missed relocations during the analysis.
[!CAUTION] The object file exporters rely on the results of the relocation table synthesizer analyzer. When in doubt, run this analyzer right before exporting an object file to make sure the relocation table contents are up-to-date.
Object files are made of three parts:
When a linker is invoked to generate an executable from a bunch of object files, it will:
Normally, the relocation table is discarded after this process, as well as the symbol table if debugging symbols aren't kept, leaving only the un-relocatable section bytes. However, through careful analysis this data can be recreated, which allows us to then effectively delink the program back into object files.
Assembly
93.9%
Java
5.6%