by haolez · 1y ago · 0 comments
> all information relevant to the execution of the program can certainly be recovered.
This is moving goalposts as it has little to do with my original premise.
Of course we're a long way off from this, but there's no reason it couldn't be done in theory.
1:1 Source recovery is never the goal of decompilation, or reverse engineering in general. You just want functionally equivalent, idiomatic code.
Your original comment was (replying to one) about “decompilation” of binaries. You seem to be talking about some fantasy perfect decompilation that gets variable names too, but no such decompilation tool or human-employable method does this, and I would argue that variable names aren’t information so much as they’re implicit context - proper code implies certain variable names (stylistic differences notwithstanding) and vice versa.
That means even though information is irrecoverably transformed during compilation, LLM could come up with semantically valid expanded solution that both fits the compiled information, that is it can be recompiled successfully, and makes sense semantically for whoever would eventually want to evolve the decompiled code with an understanding of the domain.
So the goal isn't to recover exactly what code really was, but to provide a possible solution that fits and is useful.
It’s a guess, sure, but I don’t see why it would be a less good guess than a human’s.
> Stuff like variable names won’t be exact
Yes, this is the point of my comment around information loss. Lossy transformations inherently cannot be recovered with absolute certainty, and the degree of certainty depends on available context.
This is true for absolutely any system which produces lossy transformations, not just in the context of code and LLMs, but encoders, etc.
For that purpose there is no reason LLMs can’t be as good as the best humans.
There is no good way to reconstruct that, AI/ML or not.