Crate threatflux_binary_analysis

Source
Expand description

§ThreatFlux Binary Analysis Library

A comprehensive binary analysis framework for security research, reverse engineering, and threat detection. Supports multiple binary formats with advanced analysis capabilities.

§Features

  • Multi-format Support: ELF, PE, Mach-O, Java, WASM
  • Disassembly: Multi-architecture support via Capstone and iced-x86
  • Control Flow Analysis: CFG construction, complexity metrics, anomaly detection
  • Symbol Resolution: Debug info parsing, demangling, cross-references
  • Entropy Analysis: Statistical analysis, packing detection
  • Security Analysis: Vulnerability patterns, malware indicators

§Quick Start

use threatflux_binary_analysis::BinaryAnalyzer;

// Example with minimal data - analysis may fail for incomplete binaries
let data = vec![0x7f, 0x45, 0x4c, 0x46]; // ELF magic

let analyzer = BinaryAnalyzer::new();
match analyzer.analyze(&data) {
    Ok(analysis) => {
        println!("Format: {:?}", analysis.format);
        println!("Architecture: {:?}", analysis.architecture);
    }
    Err(e) => {
        println!("Analysis failed: {}", e);
    }
}

Re-exports§

pub use error::BinaryError;
pub use error::Result;
pub use types::AnalysisResult;
pub use types::Architecture;
pub use types::BasicBlock;
pub use types::BinaryFormat;
pub use types::BinaryFormatParser;
pub use types::BinaryFormatTrait;
pub use types::BinaryMetadata;
pub use types::CallGraph;
pub use types::CallGraphConfig;
pub use types::CallGraphEdge;
pub use types::CallGraphNode;
pub use types::CallGraphStatistics;
pub use types::ComplexityMetrics;
pub use types::ControlFlowGraph;
pub use types::EnhancedControlFlowAnalysis;
pub use types::EntropyAnalysis;
pub use types::Export;
pub use types::Function;
pub use types::HalsteadMetrics;
pub use types::Import;
pub use types::Instruction;
pub use types::Loop;
pub use types::LoopType;
pub use types::NodeType;
pub use types::Section;
pub use types::SecurityIndicators;
pub use types::Symbol;

Modules§

analysis
Analysis modules for binary analysis
error
Error types for binary analysis operations
formats
Binary format parsers and detection
types
Core types and data structures for binary analysis
utils
Utility functions for binary analysis

Structs§

AnalysisConfig
Configuration for binary analysis
BinaryAnalyzer
Main entry point for binary analysis
BinaryFile
Parsed binary file representation