decbench-dataset
收藏资源简介:
DecBench反编译器基准测试数据集是一个用于系统评估反编译器的综合基准套件。它采用一个三阶段流程:编译、反编译和评估。数据集包含从40个C语言项目中编译得到的二进制文件(ELF/PE格式)、经过头文件剥离的源代码、由六种主流反编译器(包括angr、phoenix、Ghidra、IDA Pro、Binary Ninja和kuna)生成的函数级反编译C代码输出,以及从源代码提取的控制流图(CFG)。每个函数在三个不同的优化级别(O0、O2和O2-noinline)下被独立编译和评估,总计提供了超过11万个函数样本。数据集通过三个核心指标对反编译结果进行评分:GED(基于源代码与反编译代码控制流图之间的编辑距离衡量结构正确性,完美值为0)、type_match(将恢复的类型与DWARF调试信息中的基准类型进行匹配衡量类型正确性,完美值为1.0)和byte_match(将反编译的C代码重新编译并与原始二进制代码进行字节比较衡量重新编译相似性,完美值为1.0)。数据被划分为四种可下载配置:full(包含全部数据,110,992个函数和806个二进制文件)、hard(仅包含O2-noinline优化级别下的大型函数)、hard-inlined(仅包含O2优化级别下的大型函数)和tiny(一个约100个函数的代表性小样本,用于快速测试)。该数据集旨在支持逆向工程、二进制分析和程序理解领域的研究,特别是用于衡量和比较不同反编译器在恢复代码结构、类型信息和语义等价性方面的能力。需要注意的是,full配置中包含少量源自真实恶意软件(如mirai和mydoom)的编译后二进制文件,这些仅作为具有挑战性的静态分析基准,用户应避免执行这些文件。
The DecBench decompiler benchmark dataset is a comprehensive benchmark suite for systematically evaluating decompilers. It employs a three-stage process: compilation, decompilation, and evaluation. The dataset includes binary files (in ELF/PE formats) compiled from 40 C language projects, header-stripped source code, function-level decompiled C code outputs generated by six mainstream decompilers (angr, phoenix, Ghidra, IDA Pro, Binary Ninja, and kuna), and control flow graphs (CFGs) extracted from source code. Each function is independently compiled and evaluated at three different optimization levels (O0, O2, and O2-noinline), providing over 110,000 function samples in total. The dataset scores decompilation results using three core metrics: GED (structural correctness based on edit distance between source and decompiled code CFGs, with a perfect value of 0), type_match (type correctness by matching recovered types against baseline types from DWARF debugging information, with a perfect value of 1.0), and byte_match (recompilation similarity by recompiling decompiled C code and comparing bytes with original binaries, with a perfect value of 1.0). The data is divided into four downloadable configurations: full (all data, 110,992 functions and 806 binaries), hard (only large functions at the O2-noinline optimization level), hard-inlined (only large functions at the O2 optimization level), and tiny (a representative small sample of about 100 functions for quick testing). The dataset aims to support research in reverse engineering, binary analysis, and program understanding, particularly for measuring and comparing the capabilities of different decompilers in recovering code structure, type information, and semantic equivalence. Note that the full configuration includes a small number of compiled binaries from real malware (e.g., mirai, mydoom), which are included solely as challenging static analysis benchmarks, and users should avoid executing these files.
DecBench 反编译器基准测试数据集
数据集概述
DecBench 是一个用于评估反编译器的基准测试套件,采用三阶段流水线:编译 → 反编译 → 评估。C 项目在多个优化级别下编译,每个范围内的函数由每个支持的反编译器进行反编译,并通过三种指标对输出进行评分。该仓库包含一次完整 DecBench 运行中发布的数据:编译后的二进制文件、项目源代码、反编译输出、源代码控制流图以及每个函数的分数。
数据集结构
decbench-dataset/ ├── README.md # 数据集卡片 ├── dataset.toml # 顶层索引:配置 + 数据集元数据(计数、反编译器、指标) ├── configs/ # 每个配置的下载清单和分数切片 │ ├── tiny/manifest.json # 一个配置的完整文件列表 │ ├── tiny/function_results.json# 筛选出的分数 │ ├── hard/… # 其他配置类似 │ ├── hard-inlined/… │ └── full/manifest.json ├── binaries/<opt>/<project>/<file> # 编译的基准二进制文件(ELF/PE) ├── sources/<project>/<tu>.c # 去除头文件的项目 C 源代码 ├── pipeline_data/ │ └── source_cfgs/<opt>/<project>/<stem>.json# 每个函数的源代码控制流图(节点链接 JSON) ├── results/ │ ├── function_results.json # 所有反编译器的每个函数主分数 │ ├── scoreboard.toml # 聚合排行榜 │ └── <decompiler>/<opt>/<project>/<stem>.c # 反编译的 C 输出 └── decbench_data/ # 轻量级消费者 CLI
优化级别
每个项目在三个优化级别下构建,每个级别是一个独立的数据点:
| 优化级别 | 标志 | 含义 |
|---|---|---|
O0 |
-O0 |
未优化——简单情况 |
O2 |
-O2 |
优化,包含内联——真正的 -O2 |
O2-noinline |
-O2 -fno-inline |
O2 禁用内联 |
O2有时被称为 "O2-inlined",因为它包含内联O2-noinline关闭内联,隔离内联对其他优化的影响
下载配置
数据被分为四个配置:
| 配置 | 函数数 | 二进制文件数 | 描述 |
|---|---|---|---|
full |
110,992 | 806 | 全部——40 个项目 × O0 + O2 + O2-noinline |
hard |
2,252 | 201 | 优化,无内联(O2-noinline),大函数 |
hard-inlined |
2,527 | 229 | 类似 hard 但包含内联(O2),大函数 |
tiny |
100 | 100 | 约 100 个函数,均匀采样,快速代表性切片 |
full涵盖 40 个项目和 806 个二进制文件tiny配置是可重现的随机样本,每个二进制文件最多取一个函数
反编译器与指标
反编译器
六个反编译器后端被评估:
| 反编译器 | 说明 |
|---|---|
angr |
angr 默认(SAILR)结构器 |
phoenix |
angr 驱动,使用 Phoenix 结构器 |
ghidra |
NSA Ghidra |
ida |
IDA Pro (Hex-Rays) |
binja |
Binary Ninja |
kuna |
kuna 后端 |
评估指标
每个函数通过三种指标评分:
- GED(结构正确性)——源代码 CFG 与反编译 CFG 之间的控制流图编辑距离。完美 = 0(相同结构)。越低越好。
- type_match(类型正确性)——将恢复的变量/参数类型与 DWARF 真实值匹配。完美 = 1.0(每个真实类型都匹配)。越高越好。
- byte_match(重新编译相似性)——使用与原始二进制格式/架构匹配的工具链和标志重新编译反编译的 C,并比较汇编。完美 = 1.0(逐字节等价代码)。越高越好。
排行榜中的 Overall 排名:函数在所有适用指标上都完美时才被认为是"完美总体"。
快速开始
安装轻量级消费者 CLI:
bash pip install decbench-data
命令:
bash decbench-data list # 显示配置和计数 decbench-data info tiny # 查看 tiny 内容 decbench-data download tiny --dest ./decbench-tiny # 下载 tiny 切片
支持使用 --include 只下载部分内容,使用 --revision 指定分支/标签,以及通过 --repo-path 或 DECBENCH_DATASET_LOCAL 环境变量使用本地模式。
源代码 CFG 复用
pipeline_data/source_cfgs/<opt>/<project>/<stem>.json 以节点链接 JSON 格式存储每个函数的 CFG。GED 是纯结构性的——比较仅图拓扑,不读取节点标签或属性。可以重建 nx.DiGraph 并重现 GED 分数。
伦理与安全
full 配置包含少量来自 theZoo 的真实恶意软件目标(如 mirai、mydoom 等),仅作为编译后的二进制文件及其反编译/评分输出存在,用于基准测试的结构/类型恢复,不要执行这些二进制文件。





