Skip to content

ycsgg/sagitta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sagitta

Sagitta 是纯 Rust 的轻量二进制分析引擎,聚焦 x86/x64 ELF/PE 的控制流图(CFG)重建与函数恢复

功能

  • 加载 ELF/PE 镜像,解析段、节、符号、导入表。
  • 反汇编并重建控制流图(basic block 与跳转关系)。
  • 恢复函数边界与调用关系。
  • 解析间接跳转与调用(含 jump table / switch)。
  • 以 JSON、文本或 DOT 格式导出结果。

安装

cargo build --release -p sagitta-cli

使用

# 列出恢复出的函数
sagitta functions --binary path/to/binary

# 导出完整分析结果为 JSON
sagitta dump --binary path/to/binary --format json

# 导出函数控制流图为 DOT
sagitta cfg --binary path/to/binary --format dot --output cfg.dot

作为 Rust 库:

use sagitta::{analyze_path, AnalysisConfig};

let analysis = analyze_path("path/to/binary", AnalysisConfig::default())?;
for func in analysis.functions() {
    println!("{:#x} {:?}", func.entry(), func.name());
}

命令行用法见 CLI 指南,库用法见 库指南,更多示例见 示例。可运行的库示例在 crates/sagitta/examples/

cargo run -p sagitta --example list_functions -- path/to/binary

与 angr / radare2 的对比

Sagitta 在一组 showcase 与真实样本上,与 angr(CFGFast)和 radare2(aa/aaa) 的函数/CFG 恢复及耗时对比矩阵见 对比矩阵

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages