A low-level tool to inspect and visualize binary file structures with a beautiful Terminal User Interface (TUI).
- 🔍 Multi-Format Support: ELF, PE, PNG, and PDF file formats
- 📊 Hex Viewer: Display binary data in hex and ASCII format
- 🎨 TUI Interface: Beautiful terminal interface powered by Bubble Tea
- 🔧 Modular Design: Extensible parser architecture for adding new formats
- 🖥️ Cross-Platform: Works on Linux, macOS, and Windows
- 📝 Detailed Inspection: View headers, sections, offsets, and data types
git clone https://github.com/BaseMax/go-binspect.git
cd go-binspect
go build -o binspect ./cmd/binspectgo install github.com/BaseMax/go-binspect/cmd/binspect@latestbinspect <file>Inspect an ELF binary:
binspect /bin/lsInspect a PNG image:
binspect image.pngInspect a PDF document:
binspect document.pdfInspect a Windows executable:
binspect program.exeOnce the TUI is running, use these keys to navigate:
- 1: Overview - Shows file format, size, and summary
- 2: Headers - Displays file headers with fields and offsets
- 3: Sections - Shows all sections with their properties
- 4: Hex Dump - View raw binary data in hex format
- ↑/↓ or j/k: Scroll up/down
- Page Up/Down: Scroll by page
- Home: Jump to top
- q or Ctrl+C: Quit
- Linux executables and shared libraries
- Displays architecture, class, data encoding
- Shows section information
- Windows executables (.exe, .dll)
- Displays machine type and section details
- Shows DOS and PE headers
- Image files with detailed chunk information
- IHDR header with width, height, bit depth
- Chunk-by-chunk breakdown
- Document structure analysis
- Version information
- Object and cross-reference table inspection
The tool is organized into several packages:
- cmd/binspect: Main application entry point
- internal/parser: File format parsers (ELF, PE, PNG, PDF)
- internal/reader: Hex view and binary reading utilities
- internal/ui: TUI components using Bubble Tea
To add support for a new file format:
- Create a new parser file in
internal/parser/ - Implement the
Parserinterface:type Parser interface { Detect(data []byte) bool Parse(reader interface{}) (*FileInfo, error) GetName() string }
- Register the parser in
cmd/binspect/main.go
Run the test suite:
go test ./...Run tests with coverage:
go test -cover ./...go-binspect/
├── cmd/
│ └── binspect/ # Main application
│ └── main.go
├── internal/
│ ├── parser/ # File format parsers
│ │ ├── parser.go # Parser interface
│ │ ├── elf.go # ELF parser
│ │ ├── pe.go # PE parser
│ │ ├── png.go # PNG parser
│ │ └── pdf.go # PDF parser
│ ├── reader/ # Binary reading utilities
│ │ └── hexview.go # Hex dump formatter
│ └── ui/ # TUI components
│ └── tui.go # Bubble Tea UI
├── go.mod
├── go.sum
└── README.md
go build -o binspect ./cmd/binspect./binspect <file>Contributions are welcome! Here are some ways you can contribute:
- Add support for new file formats (Mach-O, COFF, WASM, etc.)
- Improve existing parsers with more detailed information
- Add more TUI features (search, filtering, export)
- Improve documentation and examples
- Report bugs and suggest features
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Max Base
- GitHub: @BaseMax
- Built with Bubble Tea TUI framework
- Styled with Lip Gloss
- Inspired by tools like
hexdump,objdump, andreadelf