Show HN: A Ghidra extension that turns programs back into object files (github.com)
Hi all, I've been working on tooling that can reverse the work of a linker. It allows one to take bits and pieces of an executable and delink them into working object files, which can then be reused as-is to make new programs or libraries, without having to decompile or disassemble them first.
The readme has links to my blog demonstrating some of the use-cases. The most impressive one so far is making a port of a ~100 KiB Linux a.out i386 program to a native Windows PE i386 executable, despite not having access to its original source code or even decompiling it.
Currently, 32-bit i386 and MIPS instruction sets are supported, with exportation to ELF object files. Additional ISAs and object file formats can be added by writing a relocation synthesizer and an exporter, respectively.
4 comments
[ 3.0 ms ] story [ 21.4 ms ] threadThis is indeed really impressive!
(direct link: https://boricj.net/atari-jaguar-sdk/2024/01/02/part-5.html )
That being said, maybe it's possible to perform a delinkage and then run a static recompiler on the object file. I don't know how that would compare to running a decompiler on the object file.