Saved in:
Bibliographic Details
Main Authors: Xu, Xiangzhe, Zhang, Zhuo, Su, Zian, Huang, Ziyang, Feng, Shiwei, Ye, Yapeng, Jiang, Nan, Xie, Danning, Cheng, Siyuan, Tan, Lin, Zhang, Xiangyu
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2306.02546
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909419593269248
author Xu, Xiangzhe
Zhang, Zhuo
Su, Zian
Huang, Ziyang
Feng, Shiwei
Ye, Yapeng
Jiang, Nan
Xie, Danning
Cheng, Siyuan
Tan, Lin
Zhang, Xiangyu
author_facet Xu, Xiangzhe
Zhang, Zhuo
Su, Zian
Huang, Ziyang
Feng, Shiwei
Ye, Yapeng
Jiang, Nan
Xie, Danning
Cheng, Siyuan
Tan, Lin
Zhang, Xiangyu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2306_02546
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Symbol Preference Aware Generative Models for Recovering Variable Names from Stripped Binary
Xu, Xiangzhe
Zhang, Zhuo
Su, Zian
Huang, Ziyang
Feng, Shiwei
Ye, Yapeng
Jiang, Nan
Xie, Danning
Cheng, Siyuan
Tan, Lin
Zhang, Xiangyu
Software Engineering
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.
title Symbol Preference Aware Generative Models for Recovering Variable Names from Stripped Binary
topic Software Engineering
url https://arxiv.org/abs/2306.02546