一句话:系统评测主流反编译器的语义一致性与可读性,揭示其准确率与代码可读性缺陷,并指出改进方向。
在恶意软件分析与漏洞挖掘等安全任务中,逆向工程至关重要,而 C 反编译器是理解程序语义的关键工具。然而逆向工程师在分析复杂二进制时仍主要依赖汇编代码,这凸显了现有反编译代码的局限。本文对当前主流反编译器进行系统评测,从语义一致性与可读性两个维度展开。语义评测结果表明,最先进的 Hex-Rays 在几乎所有优化级别下准确率仅约 55%,这与许多逆向工程师认为反编译器通常准确的观点相悖。可读性评测表明,尽管经过多年改进,基于模板的方法生成的代码仍主要呈现二进制结构特征,而非人类编码风格。此外,人工研究(human study)显示,引入人类或编译器感知的策略(如 speculate-verify-correct 方法获得可重编译的反编译代码并迭代精化,使其更接近原始二进制)可能是比依赖静态分析与规则扩展更有效的优化途径。
In software security tasks like malware analysis and vulnerability mining, reverse engineering is pivotal, with C decompilers playing a crucial role in understanding program semantics. However, reverse engineers still predominantly rely on assembly code rather than decompiled code when analyzing complex binaries. This practice underlines the limitations of current decompiled code, which hinders its effectiveness in reverse engineering. Identifying and analyzing the problems of existing decompilers and making targeted improvements can effectively enhance the efficiency of software analysis. In this study, we systematically evaluate current mainstream decompilers’ semantic consistency and readability. Semantic evaluation results show that the state-of-the-art decompiler Hex-Rays has about 55% accuracy at almost all optimization, which contradicts the common belief among many reverse engineers that decompilers are usually accurate. Readability evaluation indicates that despite years of efforts to improve the readability of the decompiled code, decompilers’ template-based approach still predominantly yields code akin to binary structures rather than human coding patterns. Additionally, our human study indicates that to enhance decompilers’ accuracy and readability, introducing human or compiler-aware strategies like a speculate-verify-correct approach to obtain recompilable decompiled code and iteratively refine it to more closely resemble the original binary, potentially offers a more effective optimization method than relying on static analysis and rule expansion.