Its role is to determine which high-level control flow structures should be presented to the user in the ctree listing. This phase operates on the final microcode, after all analysis and transformation, but before the ctree has been constructed. The major differences between the two are that the microcode does not have high-level control flow structures such as loops (it uses goto statements and assembly-like conditional branches instead), and that type information plays a relatively minor role in the microcode phase, whereas it plays a major role in the ctree phase.īetween the microcode and ctree phases, there is a brief phase known internally as hxe_structural, which performs so-called "structural analysis". The ctree phase contains relatively little code that resembles standard compiler optimizations - some pattern transformations are close - whereas much of the code in the microcode phase resembles standard compiler analysis. The ctree analysis phases, on the other hand, are more focused on the listing that gets presented to the user. To learn more, I'd recommend reading Ilfak's blog entry and installing the Lucid microcode explorer. The microcode phase covers the core decompilation logic, such as: translating the assembly instructions into an intermediate representation applying compiler-esque transformations such as data flow analysis, constant propagation, forward substitution, dead store elimination, and so on analyzing function calls and more. The decompiler operates in two major phases, known internally as "microcode" and "ctree". I recently learned the answer, so I decided to document it for posterity.Īnswering this question requires some discussion of Hex-Rays internals. Given that somebody asked me about it on Twitter, it's clear that I'm not the only one who's had this question. Logically, while(2) behaves the same as while(1) - both loops are infinite - but I wondered where they came from, what they meant, and why Hex-Rays produces them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |