ReCopilot:二进制分析中的Copilot逆向工程
ReCopilot: Reverse Engineering Copilot in Binary Analysis
AI总结:
针对二进制分析劳动密集且依赖专家知识的问题,提出专家LLM ReCopilot,通过领域数据训练和上下文增强,在函数名恢复等任务上超越现有工具13%,推动二进制分析自动化。
摘要:
二进制分析在恶意软件检测和漏洞发现等安全领域发挥着关键作用,然而它仍然劳动密集且高度依赖专家知识。通用大语言模型(LLMs)在源代码的编程分析方面表现良好,而针对二进制的专用LLM尚未得到充分探索。在这项工作中,我们提出了ReCopilot,一个专为二进制分析任务设计的专家级LLM。ReCopilot通过一个精心构建的数据集整合了二进制代码知识,涵盖持续预训练(CPT)、监督微调(SFT)和直接偏好优化(DPO)阶段。它利用变量数据流和调用图来增强上下文感知,并采用测试时扩展(test-time scaling)来提高推理能力。在一个全面的二进制分析基准上的评估表明,ReCopilot在反编译伪代码的函数名恢复和变量类型推断等任务上达到了最先进的性能,比现有工具和LLM高出13%。我们的研究结果凸显了领域特定训练和上下文增强的有效性,同时也揭示了构建超长思维链(chain-of-thought)所面临的挑战。ReCopilot代表了在该领域通过可解释且可扩展的AI辅助实现二进制分析自动化迈出的重要一步。
英文摘要:
Binary analysis plays a pivotal role in security domains such as malware detection and vulnerability discovery, yet it remains labor-intensive and heavily reliant on expert knowledge. General-purpose large language models (LLMs) perform well in programming analysis on source code, while binaryspecific LLMs are underexplored. In this work, we present ReCopilot, an expert LLM designed for binary analysis tasks. ReCopilot integrates binary code knowledge through a meticulously constructed dataset, encompassing continue pretraining (CPT), supervised fine-tuning (SFT), and direct preference optimization (DPO) stages. It leverages variable data flow and call graph to enhance context awareness and employs test-time scaling to improve reasoning capabilities. Evaluations on a comprehensive binary analysis benchmark demonstrate that ReCopilot achieves state-of-the-art performance in tasks such as function name recovery and variable type inference on the decompiled pseudo code, outperforming both existing tools and LLMs by 13%. Our findings highlight the effectiveness of domain-specific training and context enhancement, while also revealing challenges in building super long chain-of-thought. ReCopilot represents a significant step toward automating binary analysis with interpretable and scalable AI assistance in this domain.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。