SLaDe:用于优化汇编的便携式小型语言模型反编译器
SLaDe: A Portable Small Language Model Decompiler for Optimized Assembly
AI总结:
本文提出SLaDe,一种基于序列到序列transformer的小型语言模型反编译器,通过新型分词器、无dropout训练和类型推断生成高质量代码,在ExeBench上准确率显著优于Ghidra和ChatGPT。
摘要:
反编译是一个被广泛研究的领域,拥有众多高质量工具。这些工具常用于安全任务和移植遗留代码。然而,它们经常生成难以阅读的程序,并且需要大量工程努力来支持新的编程语言和ISA。近期对神经方法的关注催生了能生成可读代码的便携式工具。然而,迄今为止此类技术通常局限于未优化的合成程序,且没有模型评估过其便携性。此外,生成的代码虽更可读,但通常是不正确的。本文提出SLaDe,一种基于在真实代码上训练的序列到序列transformer的小型语言模型反编译器。我们开发了新型分词器并利用无dropout训练来生成高质量代码。我们利用类型推断生成比标准分析和最新神经方法更可读且准确的程序。与标准方法不同,SLaDe能推断上下文外类型;与神经方法不同,它能生成正确的代码。我们在ExeBench的4,000多个函数上,在两种ISA和两个优化级别下评估SLaDe。SLaDe的准确率比工业级反编译器Ghidra高6倍,比大语言模型ChatGPT高4倍,且生成的代码可读性显著优于两者。
英文摘要:
Decompilation is a well-studied area with numerous high-quality tools available. These are frequently used for security tasks and to port legacy code. However, they regularly generate difficult-to-read programs and require a large amount of engineering effort to support new programming languages and ISAs. Recent interest in neural approaches has produced portable tools that generate readable code. However, to-date such techniques are usually restricted to synthetic programs without optimization, and no models have evaluated their portability. Furthermore, while the code generated may be more readable, it is usually incorrect. This paper presents SLaDe, a Small Language model Decompiler based on a sequence-to-sequence transformer trained over real-world code. We develop a novel tokenizer and exploit no-dropout training to produce high-quality code. We utilize type-inference to generate programs that are more readable and accurate than standard analytic and recent neural approaches. Unlike standard approaches, SLaDe can infer out-of-context types and unlike neural approaches, it generates correct code. We evaluate SLaDe on over 4,000 functions from ExeBench on two ISAs and at two optimizations levels. SLaDe is up to 6 times more accurate than Ghidra, a state-of-the-art, industrial-strength decompiler and up to 4 times more accurate than the large language model ChatGPT and generates significantly more readable code than both.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。