2 ms·
Really cool project. I’ve been thinking about this problem for a few years now, and have often wanted to try something very similar. Two years ago I posted a co
by chatmasta 9y ago
Really cool project. I’ve been thinking about this problem for a few years now, and have often wanted to try something very similar. Two years ago I posted a comment on HN [0] outlining my thoughts on how a system similar to this could be used for vulnerability mining, by decompiling security patch bindiffs and looking for other software with binary regions similar to the one patched with the security update.
The idea of decompiling code into human readable form has a certain romance to it. Taken to its extreme, it’s the first step in enabling an AI to write a program.
Most researchers are too scared to touch the problem because getting it “perfect” is almost certainly NP-hard, effectively impossible. So kudos to you for trying these techniques. The success you’ve seen, however limited, certainly pushes the boundaries and hopefully gets more people interested in this problem space.
There is a lot of cool stuff you can do with decompilation. Despite it being a hard problem, you’ve demonstrated that there are many shortcuts and heuristics we can use to make solving it easier.
I really liked the quote you cited from Gabel and Su:
> general lack of uniqueness in software at levels of granularity equivalent to approximately one to seven lines of source code [...] crossing both project and programming language boundaries.
That is the key point that makes this research viable IMO. Programmers are not writing unique code, because they depend on idioms and conventions that are the most “human readable” way of expressing certain bundles of logic. Think how many times you've written a for loop that breaks on a condition, for example. Or an if(a && !b) {...} else {...}.
I’m not surprised at all that so many lines of code are just reinventing tiny wheels over and over again, because ultimately those 1-10 line snippets of control structures are the second-order building blocks of programming. Simplifying things a bit, the only changes between implementations of a common idiom are the variable names and scope, because these are what contextualize the idiom to a human reader. But the compiler doesn’t care about that.
[0] https://news.ycombinator.com/item?id=11573547 https://news.ycombinator.com/item?id=11573547