Large language models (LLMs) have recently been applied to binary decompilation, yet they still treat code as plain text and ignore the graphs that govern program control flow. This limitation often yields syntactically fragile and logically inconsistent output, especially for optimized binaries. This paper presents \textsc{HELIOS}, a framework that reframes LLM-based decompilation as a structured reasoning task. \textsc{HELIOS} summarizes a binary's control flow and function calls into a hierarchical text representation that spells out basic blocks, their successors, and high-level patterns such as loops and conditionals. This representation is supplied to a general-purpose LLM, along with raw decompiler output, optionally combined with a compiler-in-the-loop that returns error messages when the generated code fails to build. On HumanEval-Decompile for \texttt{x86\_64}, \textsc{HELIOS} raises average object file compilability from 45.0\% to 85.2\% for Gemini~2.0 and from 71.4\% to 89.6\% for GPT-4.1~Mini. With compiler feedback, compilability exceeds 94\% and functional correctness improves by up to 5.6 percentage points over text-only prompting. Across six architectures drawn from x86, ARM, and MIPS, \textsc{HELIOS} reduces the spread in functional correctness while keeping syntactic correctness consistently high, all without fine-tuning. These properties make \textsc{HELIOS} a practical building block for reverse engineering workflows in security settings where analysts need recompilable, semantically faithful code across diverse hardware targets.


翻译:大语言模型(LLM)近期已被应用于二进制反编译,但其仍将代码视为纯文本,忽略了支配程序控制流的图结构。这一局限常导致生成句法脆弱且逻辑不一致的输出,尤其针对优化后的二进制文件。本文提出HELIOS框架,将基于LLM的反编译重构为结构化推理任务。HELIOS将二进制文件的控制流与函数调用总结为层次化文本表示,该表示显式描述基本块、其后继块以及循环与条件判断等高级模式。该表示与原始反编译器输出共同提供给通用LLM,并可选择性结合编译器在环机制——当生成代码编译失败时返回错误信息。在x86_64架构的HumanEval-Decompile基准测试中,HELIOS将Gemini 2.0的平均目标文件可编译率从45.0%提升至85.2%,将GPT-4.1 Mini的可编译率从71.4%提升至89.6%。结合编译器反馈后,可编译率超过94%,功能正确性较纯文本提示提升最高达5.6个百分点。在涵盖x86、ARM和MIPS的六种架构测试中,HELIOS在保持句法正确性持续高位的同时,缩小了功能正确性的离散程度,且无需微调。这些特性使HELIOS成为安全领域逆向工程工作流的实用构建模块,适用于需要跨异构硬件目标生成可重编译且语义保真代码的分析场景。

0
下载
关闭预览

相关内容

绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员