FidelityGPT: Correcting Decompilation Distortions with Retrieval Augmented Generation
Zhiping Zhou, Xiaohong Li, Ruitao Feng, Yao Zhang, Yuekang Li, Wenbu Feng, Yunqian Wang, Yuqing Li
摘要
Decompilation is a crucial technique that converts machine code into a human-readable format, facilitating analysis and debugging in the absence of source code. However, this process is hindered by fidelity issues, which can significantly impair the readability and accuracy of the decompiled output. Existing approaches partially addressed these, such as variable renaming and structural simplification, but typically fail to provide adequate detection and correction, especially in complex but practical closed-source binary scenarios. To address this, we introduce FidelityGPT, a novel framework to improve the accuracy and readability of decompiled code by systematically detecting and correcting discrepancies between decompiled code and its original source. FidelityGPT defines distortion prompt templates tailored to closed-source environments and incorporates Retrieval-Augmented Generation (RAG) with a dynamic semantic intensity algorithm. The algorithm identifies distorted lines based on semantic intensity, retrieving similar code from a database. Additionally, a variable dependency algorithm is designed to overcome the limitations of long-context inputs by analyzing redundant variables through their dependencies and integrating redundant variable names into prompt context. These combined techniques establish FidelityGPT as the first framework capable of effectively addressing decompilation distortion issues in LLM-based decompilation optimization. We evaluated FidelityGPT on 620 function pairs from a binary similarity benchmark, achieving an average detection accuracy of 89% and a precision of 83%. Compared to the current state-of-the-art model, DeGPT, which achieved an average Fix Rate (FR) of 83% and an average Corrected Fix Rate (CFR) of 37%, FidelityGPT demonstrated superior performance. With an average FR of 94% and an average CFR of 64%, FidelityGPT significantly improves both accuracy and readability, underscoring its effectiveness in enhancing decompilation and its potential to drive advancements in reverse engineering.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Oxidizer: Toward Concise and High-fidelity Rust Decompilation 引用了 LLM4Decompile: Decompiling Binary Code with Large Language Models
- No More Translation at Runtime: LLM-Empowered Static Binary Translation 引用了 LLM4Decompile: Decompiling Binary Code with Large Language Models
- No More Translation at Runtime: LLM-Empowered Static Binary Translation 引用了 The Power of Noise: Redefining Retrieval for RAG Systems
- No More Translation at Runtime: LLM-Empowered Static Binary Translation 引用了 How far we have come: testing decompilation correctness of C decompilers
- LLM4Decompile: Decompiling Binary Code with Large Language Models 引用了 How far we have come: testing decompilation correctness of C decompilers
引用它的顶会 Paper2
它引用的 Paper20
- Finetuned Language Models are Zero-Shot LearnersJason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu 等ICLR 2022 · 4,966 次引用
- The Power of Noise: Redefining Retrieval for RAG SystemsFlorin Cuconasu, Giovanni Trappolini, Federico Siciliano, Simone Filice 等SIGIR 2024 · 212 次引用
- The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG)Shenglai Zeng, Jiankun Zhang, Pengfei He, Yiding Liu 等ACL Findings 2024 · 104 次引用
- How far we have come: testing decompilation correctness of C decompilersZhibo Liu, Shuai WangISSTA 2020 · 53 次引用
- LLM4Decompile: Decompiling Binary Code with Large Language ModelsHanzhuo Tan, Qi Luo, Jing Li, Yuqun ZhangEMNLP 2024 · 31 次引用
相关 Paper
- BinRAG: An RAG-Based Decompilation Framework Fusing Name Prediction and Calling ContextWai Kin Wong, Daoyuan Wu, Zhibo Liu, Huaijin Wang 等ISSTA 2026
- DeGPT: Optimizing Decompiler Output with LLMPeiwei Hu, Ruigang Liang, Kai ChenNDSS 2024
- PseudoFix: Refactoring Distorted Structures in Decompiled C PseudocodeGangyang Li, Xiuwei Shang, Shaoyin Cheng, Junqi Zhang 等ASE 2025 · 1 次引用
- Between Lines of Code: Unraveling the Distinct Patterns of Machine and Human ProgrammersYuling Shi, Hongyu Zhang, Chengcheng Wan, Xiaodong GuICSE 2025 · 9 次引用
- Learn-to-Distance: Distance Learning for Detecting LLM-Generated TextHongyi Zhou, Jin Zhu, Kai Ye, Ying Yang 等ICLR 2026 · 10 次引用
