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