ELF relocatable object exporter, part 2 #6102
boricj
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Part 1: #4922
What is this?
ghidra-delinker-extension is a Ghidra extension that can turn parts of programs into working, relocatable object files.
It's an implementation of a technique called delinking*, whose goal is to undo the work of a linker. It allows one to take bits and pieces of programs and re-use them as part of new programs or libraries, without having to disassemble or decompile them.
Currently, the analyzers support the 32-bit i386 and MIPS architectures, additional architectures can be added by writing a relocation synthesizer. It can produce ELF object files and other formats can be implemented by writing an exporter.
What can one do with it?
I've publicly demonstrated several use-cases on my blog:
More use-cases are possible (making libraries out of parts of a program, incremental decompilation projects...), but I haven't documented them yet for the time being.
How do I use it?
The README file has instructions, but after installing this extension it boils down to:
Relocation table synthesizer
analyzer to generate relocation entries ;ELF relocatable object
exporter on a program selection.The whole workflow is automated down to a couple of clicks and is fairly similar to performing a raw bytes exportation.
What's the catch?
Using this extension doesn't require any particular skill or knowledge, but the two main source of problems during delinking can be tricky to track down:
What's the plan?
I've created this tooling for a decompilation project of mine. Now that I have publicly documented multiple case studies which proves it actually works, I figured it's time to see if there's any interest in the community for this before I resume my initial project.
Hopefully I can also make this esoteric technique more widely known and accessible to the everyday reverse-engineer. It truly makes programs feel like they are made up of LEGO® bricks.
*There are very few resources online about this topic. I do know I didn't invent it, but I haven't seen evidence suggesting it was industrialized to this point before.
Beta Was this translation helpful? Give feedback.
All reactions