A modern, feature-rich binary disassembler written in Rust with an interactive TUI and control flow graph visualization.
- Multi-architecture support: x86/x86-64 with extensible architecture framework
- Binary format parsing: PE, ELF, and other formats via goblin
- Instruction analysis: Comprehensive instruction decoding using iced-x86
- Section analysis: Automatic .text section extraction and analysis
- Advanced block detection: Smart basic block identification with jump/call target analysis
- Graph metrics: Cyclomatic complexity, branching factor, block statistics
- Multiple layouts: Grid layout for large graphs with viewport navigation
- Export support: JSON, CSV, HTML, Markdown, DOT, and Assembly formats
- Multi-tab interface: Instructions, Control Flow, Graph View, Hex Dump
- Graph navigation: Arrow key navigation between connected blocks
- Search functionality: Fast instruction search with filtering
- Viewport controls: Pan (WASD), zoom (+/-), center (C)
- Function analysis: Basic block and edge analysis
- Loop detection: Back-edge based loop identification
- Metrics calculation: Comprehensive graph statistics
- Dead code analysis: Unreachable block detection (planned)
- Rust 1.70+ (2024 edition)
- Linux/macOS/Windows
git clone https://github.com/yourusername/disassembler.git
cd disassembler
cargo build --release
# Basic disassembly
./target/release/main binary.exe
# Control flow graph with metrics
./target/release/main binary.exe --cfg --metrics
# Export analysis
./target/release/main binary.exe --cfg --output analysis.json --format json
./target/release/main binary.exe --tui





TUI Controls:
Tab
: Switch between views3
: Jump to Graph ViewArrow Keys
: Navigate graph/instructionsWASD
: Pan viewport+/-
: ZoomC
: Center on selection/
: Searchh
: Helpq
: Quit
# Use wrapper script for enhanced terminal safety
./scripts/safe_run.sh tests/notepad.exe --tui
src/main.rs
: CLI interface and application entry pointsrc/parser.rs
: Binary format parsing and section extractionsrc/arch/
: Architecture-specific disassembly enginessrc/graph.rs
: Control flow graph construction using petgraphsrc/graph_view.rs
: Graph layout and viewport managementsrc/tui.rs
: Interactive terminal user interfacesrc/export.rs
: Multi-format export functionality
iced-x86
: Fast x86/x86-64 disassemblergoblin
: Binary format parsingpetgraph
: Graph algorithms and data structuresratatui
: Terminal user interface frameworkclap
: Command line argument parsing
[METRICS] Graph Metrics:
+-----------------------------+-------------+
| Metric | Value |
+-----------------------------+-------------+
| Total Blocks | 8010 |
| Total Edges | 6600 |
| Cyclomatic Complexity | 2 |
| Average Block Size | 5.50 |
| Branching Factor | 0.82 |
+-----------------------------+-------------+
- Multi-block visualization: Proper basic block splitting
- Edge styling: Color-coded edges (conditional, unconditional, calls)
- Block details: Instruction listing and successor/predecessor info
- Navigation: Seamless movement between connected blocks
cargo build # Debug build
cargo build --release # Optimized build
cargo test # Run tests
# Test with sample binary
./target/debug/main tests/notepad.exe --cfg --metrics
# Interactive testing
./target/debug/main tests/notepad.exe --tui
If you experience terminal corruption or ANSI escape sequences:
- Emergency reset:
./emergency_reset.sh
- Use safe wrapper:
./safe_run.sh
instead of direct execution - Manual reset:
reset && clear
- Build errors: Ensure Rust 2024 edition support
- Binary parsing: Check file format compatibility
- Performance: Use
--release
build for large binaries
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes
- Add tests if applicable
- Submit a pull request
- Follow Rust standard formatting (
cargo fmt
) - Add documentation for public APIs
- Include tests for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- iced-x86: Excellent x86 disassembly engine
- petgraph: Robust graph algorithms
- ratatui: Modern terminal UI framework
- goblin: Comprehensive binary parsing