Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I linked to this with the idea that it would just be an intro. I really hoped that someone with more recent knowledge would chime in. : )

Any chance you could recommend a few good recent papers that I could kick off a good citation graph binge on?



Probably the easiest way to find relevant papers is to do reverse-citation on Cifuente's work ("Reverse Compilation Techniques" and "Structuring Decompiled Graphs").

The newest paper I've found (I was specifically looking at control flow graph structuring, which ends up being nasty to search for) is <https://net.cs.uni-bonn.de/fileadmin/ag/martini/Staff/yakdan....

Edward Schwartz's PhD thesis (<https://users.ece.cmu.edu/~ejschwar/papers/arthesis14.pdf>) covers in detail the Phoenix decompiler, which is another good jumping-off point.

All of the papers I've mentioned can be found in citations from those two sources.

As for the state-of-the-art, the basic disassembly algorithm has been well-known for a while: recursive disassembly, which is the sort of obvious algorithm you'd think of yourself if left to your own devices. The practical answer is generally "use IDA," because indirect control flow boils down to "know every single pattern that compilers generate," and IDA already knows every single pattern. Structuring control flow graphs is more or less complete in the same sense as parsing is, which is to say that we know a few different ways to do it which all suck in their all special way, but you're not going to find fertile ground to do new things, as the existing solutions are generally good enough.

The real hard part of decompilation remaining, then, is variable and type recovery. We sort of know how to do this if you assume structs, unions, and arrays don't exist (which is to say, it's more or less solved if you were to try this on CIL or JVM bytecode), but those are a massive stumbling block in native executable decompilation. I rather suspect this is going to remain unsolved until we get a good pointer and dataflow analysis on binaries that can handle integer/pointer duality and type unsafety, which puts it at least a decade away in my estimation.


"No More Gotos: Decompilation Using Pattern-Independent Control-Flow Structuring and Semantics-Preserving Transformations" deserves a look: http://www.internetsociety.org/doc/no-more-gotos-decompilati...

Pattern-independent structuring (from the above paper) is implemented by fcd, an LLVM-based native program optimizing decompiler: https://github.com/zneak/fcd/

Related blog posts have some details and examples:

- http://zneak.github.io/fcd/2016/02/24/seseloop.html

- http://zneak.github.io/fcd/2016/02/17/structuring.html

- http://zneak.github.io/fcd/2016/02/21/csaw-wyvern.html




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: