文章背景与核心概要
在软件逆向工程和二进制分析领域,反编译得到的 C 代码通常需要经过修复才能重新编译。然而,本篇论文指出,单纯的成功重新编译并不能保证代码能够保留其原有的、经测试观察到的行为。重新编译出的二进制文件仍可能存在语义问题,例如命令行选项解析错误、输出字节不一致或返回错误的退出状态。
为了解决这一痛点,本文介绍了一种简化的工作流程,结合编译器反馈与官方测试套件来修复反编译的 C 代码。该流程分为构建修复(利用编译器和链接器诊断指导初始语法和构建修复)和语义修复(一旦代码成功编译为二进制文件,通过冒烟检查和官方测试暴露行为差异,从而引导进一步的精炼)。在包含 104 个 Coreutils 9.5 二进制文件的评估中,87.5% 的二进制文件成功重新编译并通过了测试门槛,证明了引入测试门槛反馈能使大语言模型(LLM)辅助的反编译 C 代码修复比纯粹依赖编译恢复更加可靠和可审计。
重新编译远远不够:测试引导的反编译C代码修复 (Recompilation Is Not Enough: Test-Guided Decompiled-C Repair)
作者: Yuhan Huang, Puzhuo Liu, Jianlei Chi
主要学科: 软件工程 (cs.SE)
arXiv ID: arXiv:2609.07201 [cs.SE]
提交时间: 2026年9月7日
📌 摘要 (Summary)
反编译得到的 C 代码通常只有在经过修复后才能重新编译,但单纯的成功重新编译并不能保证代码能够保留其原有的、经测试观察到的行为。重新编译的二进制文件仍然可能存在语义问题——例如错误地解析命令行选项、生成不同的输出字节或返回错误的退出状态。
Decompiled C code often becomes recompilable only after undergoing repair, but successful recompilation alone does not guarantee that the code preserves its original, test-observed behavior. A recompiled binary can still suffer from semantic issues—such as parsing command-line options incorrectly, generating different output bytes, or returning an incorrect exit status.
本文介绍了一种简化的工作流程,通过结合编译器反馈与官方测试套件来修复反编译的 C 代码: 1. 构建修复: 利用编译器和链接器的诊断信息来指导初始的语法和构建修复。 2. 语义修复: 一旦代码成功编译为二进制文件,冒烟检查(smoke checks)和官方测试便会暴露行为差异,从而指导进一步的精炼。
This paper introduces a streamlined workflow for repairing decompiled C code using a combination of compiler feedback and official test suites: 1. Build Repair: Compiler and linker diagnostics guide the initial syntax and build fixes. 2. Semantic Repair: Once the code successfully compiles into a binary, smoke checks and official tests expose behavioral discrepancies, guiding further refinement.
核心发现 (Key Findings)
在基于静态增强的评估中,使用了 104 个 Coreutils 9.5 二进制文件(利用了反编译器导出功能和确定性的精确输出冒烟比较):
* 87.5%(91 个二进制文件) 成功重新编译并通过了测试门槛。
* 9 个二进制文件 在分配的修复预算内未能重新编译成功。
* 4 个二进制文件 成功重新编译,但由于行为不匹配而未通过测试门槛。
In a static-enriched evaluation using 104
Coreutils 9.5binaries (leveraging decompiler exports and deterministic exact-output smoke comparisons): * 87.5% (91 binaries) successfully recompiled and passed the test gate. * 9 binaries failed to recompile within the allocated repair budget. * 4 binaries successfully recompiled but failed the test gate due to behavioral mismatches.
这些结果表明,结合测试门槛反馈能够使大语言模型(LLM)辅助的反编译 C 代码修复比纯粹依赖仅编译恢复的方式显著更加可靠且可审计。
These results demonstrate that incorporating test-gate feedback makes Large Language Model (LLM)-assisted repair of decompiled C significantly more reliable and auditable than relying purely on compile-only recovery.
📑 论文元数据 (Paper Metadata)
- 页数与图表: 5 页,2 幅图
- 许可协议: 知识共享署名 4.0

- DOI: 10.48550/arXiv.2609.07201
- Comments: 5 pages, 2 figures
- License: Creative Commons Attribution 4.0
- DOI: 10.48550/arXiv.2609.07201