用上下文学习提升反编译可执行性,让机器生成的代码能真正跑起来。
Context-Guided Decompilation: A Step Towards Re-executability
- 引入上下文学习引导大模型生成可重编译代码
- 在多种优化级别下实现40%的可执行率提升
- 适合安全分析与恶意软件逆向研究者使用
二进制反编译在源码缺失时对软件安全分析、逆向工程和恶意软件理解至关重要。然而,现有反编译技术通常无法生成可成功重编译和重执行的源码,尤其针对经过优化的二进制文件。尽管大语言模型(LLMs)推动了神经反编译的发展,但生成代码仅语义合理,难以实际运行,限制了其可靠性。这一问题源于编译器优化及编译代码中语义线索的丢失,导致LLM缺乏上下文指导时难以恢复。为此,我们提出ICL4Decomp,一种融合上下文学习(ICL)的混合反编译框架,通过上下文引导使LLM生成可重执行的源码。我们在多个数据集、优化级别和编译器上评估该方法,结果表明其在可执行性方面相比当前最优方法提升约40%,且具有鲁棒性。
原文摘要 · Abstract (English)
Binary decompilation plays an important role in software security analysis, reverse engineering, and malware understanding when source code is unavailable. However, existing decompilation techniques often fail to produce source code that can be successfully recompiled and re-executed, particularly for optimized binaries. Recent advances in large language models (LLMs) have enabled neural approaches to decompilation, but the generated code is typically only semantically plausible rather than truly executable, limiting their practical reliability. These shortcomings arise from compiler optimizations and the loss of semantic cues in compiled code, which LLMs struggle to recover without contextual guidance. To address this challenge, we propose ICL4Decomp, a hybrid decompilation framework that leverages in-context learning (ICL) to guide LLMs toward generating re-executable source code. We evaluate our method across multiple datasets, optimization levels, and compilers, demonstrating around 40\% improvement in re-executability over state-of-the-art decompilation methods while maintaining robustness.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。