LLM4Decompile

逆向工程:使用大型語言模型反編譯二進位碼

LLM4Decompile 是什麼?

逆向工程:使用大型語言模型反編譯二進位碼。本工具旨在將二進位碼轉換為可讀的原始碼。

LLM4Decompile 概覽

這是什麼

LLM4Decompile 是一個開源的大型語言模型,專門用於反編譯。它能將 Linux x86_64 二進位檔案(使用 GCC 在 O0 到 O3 最佳化層級下編譯)轉換為人類可讀的 C 原始碼。此專案包含兩種主要方法:LLM4Decompile-End 直接反編譯二進位檔,而 LLM4Decompile-Ref 則改善 Ghidra 產生的偽代碼。

主要功能

  • 支援 Linux x86_64 二進位檔的反編譯,涵蓋 GCC 最佳化層級 O0、O1、O2 和 O3。
  • 提供參數量從 13 億到 330 億不等的模型,可在 Hugging Face 上取得。
  • 包含 LLM4Decompile-End(直接反編譯二進位檔)與 LLM4Decompile-Ref(改善 Ghidra 輸出)。
  • 使用可重新執行率(re-executability)評估反編譯程式碼是否能通過預先定義的測試案例。
  • 在 HumanEval-Decompile(164 個 C 函式)和 ExeBench(2,621 個真實專案函式)基準上進行評測。
  • 提供訓練腳本,在單張 A100 40G GPU 上約需 3.5 小時,可達到 0.26 的可重新執行率。

使用情境

  • 對 Linux x86_64 二進位檔進行逆向工程,還原 C 原始碼。
  • 對編譯後的程式進行安全分析與漏洞研究。
  • 用於教學,了解高階程式碼如何對應到二進位檔。

快速開始

git clone https://github.com/albertan017/LLM4Decompile.git cd LLM4Decompile conda create -n 'llm4decompile' python=3.9 -y conda activate llm4decompile pip install -r requirements.txt 詳細使用範例請參閱專案 README。

授權與價格

本專案採用 MIT 授權,為開源軟體。

內容整理自該專案公開的 README 與儲存庫資訊。

將此徽章加入你的 README

Featured on YunoDB 徽章樣式與說明

你是這個專案的維護者嗎?展示它已收錄於 YunoDB。

Markdown[![Featured on YunoDB](https://yunodb.com/badge/albertan017llm4decompile.svg)](https://yunodb.com/tools/albertan017llm4decompile?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/albertan017llm4decompile?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/albertan017llm4decompile.svg" alt="Featured on YunoDB" height="20"></a>