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

I wonder if Google's translation tools could be adapted to the task: "Suggest a better decompilation," perhaps?

Does anybody have a good reference for how decompilers work? When converting assembly to C by hand I always went through multiple passes (not necessarily in this order): first a literal pass that looked a lot like this dump with gotos and variables named after registers, then I'd identify if/else and switch blocks, then I'd convert any reverse gotos into a while loop, convert while loops into for loops, identify data structures, duplicate lines that had been optimized to a single reference with jmps, etc.



Pretty much that, yes.

Also, you have specific idioms for popular compilers (vc, gcc, icc, borland) and value propagation. You could even include an SMT solver to identify constraints and propagate the range to child basic blocks.




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

Search: