arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2306.02546cs.SE
收藏

面向剥离二进制文件变量名恢复的符号偏好感知生成模型

Symbol Preference Aware Generative Models for Recovering Variable Names from Stripped Binary

Xiangzhe Xu, Zhuo Zhang, Zian Su, Ziyang Huang, Shiwei Feng, Yapeng Ye, Nan Jiang, Danning Xie, Siyuan Cheng, Lin Tan, Xiangyu Zhang

AI总结:

针对反编译中变量名恢复的难题,提出结合生成模型优势并通过对齐开发者符号偏好缓解偏差的GenNm方法,在常用数据集及难例设置下均显著提升名称恢复精度。

摘要:

反编译旨在恢复二进制可执行文件的源代码形式,具备恶意软件分析、漏洞检测和代码加固等众多安全应用场景。反编译中的一项突出挑战是变量名恢复。我们提出了一种新颖技术,既能发挥生成模型的优势,又能缓解模型偏差。我们基于预训练生成模型CodeGemma-2B、CodeLlama-7B和CodeLlama-34B构建了原型系统GenNm。我们在反编译函数上对GenNm进行微调,并指导模型利用上下文信息。GenNm在查询某一函数时会纳入来自调用方和被调用方的名称,在模型的输入令牌限制内提供丰富的上下文信息。我们通过将模型的输出分布与开发者的符号偏好对齐来缓解模型偏差。我们的结果表明,在两个常用数据集上,GenNm将当前最优的名称恢复精度提升了5.6-11.4个百分点;在最具挑战性的设置(训练数据集中未见过真实变量名)下,GenNm将当前最优水平提升了32%(从17.3%提升至22.8%)。

英文摘要:

Decompilation aims to recover the source code form of a binary executable. It has many security applications, such as malware analysis, vulnerability detection, and code hardening. A prominent challenge in decompilation is to recover variable names. We propose a novel technique that leverages the strengths of generative models while mitigating model biases. We build a prototype, GenNm, from pre-trained generative models CodeGemma-2B, CodeLlama-7B, and CodeLlama-34B. We finetune GenNm on decompiled functions and teach models to leverage contextual information. GenNm includes names from callers and callees while querying a function, providing rich contextual information within the model's input token limitation. We mitigate model biases by aligning the output distribution of models with symbol preferences of developers. Our results show that GenNm improves the state-of-the-art name recovery precision by 5.6-11.4 percentage points on two commonly used datasets and improves the state-of-the-art by 32% (from 17.3% to 22.8%) in the most challenging setup where ground-truth variable names are not seen in the training dataset.

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

↑