arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.30877cs.SE
收藏

ATLAS:一种将二进制代码提升为规范编译器IR的多智能体框架

ATLAS: A Multi-Agent Framework for Lifting Binary to Canonical Compiler IR

Shaanxi Normal University(陕西师范大学);University of Leeds(利兹大学)

Xiaoao Zhu, Ni Zhang, Jie Ren, Zhiqiang Li, Jie Zheng, Zhanyong Tang, Zheng Wang

AI总结:

ATLAS是一种多智能体框架,通过结构检索与协作优化循环,将优化二进制代码提升为规范LLVM IR,在多个数据集上优于基线,实现高可重执行性与CFG相似度,支持跨ISA重编译等场景。

摘要:

当源代码不可用时,将已剥离且经过深度优化的二进制代码提升为规范的、预优化的LLVM中间表示(IR),对于下游安全分析和遗留软件迁移至关重要。然而,激进的编译器优化会重写控制流和数据流、移除结构元数据,并引入类型擦除的低级习惯用法,导致当前的提升工具生成畸形或语义不一致的IR。我们提出ATLAS,一种旨在从优化后的二进制代码中重建形式上有效且规范的LLVM IR的多智能体框架。该框架结合了:(i)基于结构的区域级检索,利用伪探针归因将优化后的指令与规范IR示例对齐;(ii)协作式优化循环,缩小概率生成与确定性编译器约束之间的差距。具体而言,Lift智能体基于检索到的示例生成初始IR草稿,Advisor智能体解读LLVM验证器/编译诊断和静态检查以提出局部修复操作,Validation智能体应用这些编辑、重新运行工具链验证以及(在可用时)运行时检查,并将得到的诊断反馈给Advisor智能体。智能体迭代直至IR通过验证且行为一致,或达到预算限制。在HumanEval-Decompile和MBPP数据集上,ATLAS在提升LLVM IR方面优于7个基线方法,在ARM、x86-64和RISC-V二进制代码上实现了91.8%的可重新执行性和89.4%的控制流图(CFG)相似度。此外,我们的评估表明,ATLAS在指针流精度和下游可分析性方面也优于Binary to C to IR流水线。通过恢复一种格式良好、以机器为中心的表示,ATLAS支持实用的跨ISA重编译和可验证的仅二进制迁移工作流。

英文摘要:

Lifting stripped, heavily optimized binaries to a canonical, pre-optimization LLVM intermediate representation (IR) is essential for downstream security analysis and legacy software migration when source code is unavailable. However, aggressive compiler optimizations rewrite control and data flow, remove structural metadata, and introduce type-erased low-level idioms, causing current lifters to produce malformed or semantically divergent IR. We present ATLAS, a multi-agent framework designed to reconstruct formally valid and canonical LLVM IR from optimized disassembly.ATLAS combines (i) Structure-aware, region-level retrieval, which utilizes pseudo-probe attribution to align optimized instructions with canonical IR exemplars, and (ii) a collaborative refinement loop that closes the gap between probabilistic generation and deterministic compiler constraints. Concretely, a Lift agent generates an initial IR draft conditioned on retrieved exemplars, an Advisor agent interprets LLVM verifier/compilation diagnostics and static checks to propose localized repair actions, and a Validation agent applies the edits, re-runs toolchain verification and (when available) runtime checks, and feeds the resulting diagnostics back to the Advisor. The agents iterate until the IR is verifier-clean and behaviorally consistent, or a budget limit is reached. On HumanEval-Decompile and MBPP, ATLAS outperforms seven baselines on lifting LLVM IR, achieving 91.8% re-executability and 89.4% CFG similarity across ARM, x86-64, and RISC-V binaries. Moreover, our evaluation demonstrates that ATLAS also outperforms the Binary to C to IR pipelines in pointer-flow precision and downstream analyzability. By recovering a well-formed, machine-centric representation, ATLAS enables practical cross-ISA recompilation and verifiable binary-only migration workflows.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑