turbohex is an interactive terminal hex viewer for exploring binary files with
live decoding. It combines a fast hex/ASCII view, selection tools, and a decode
panel that supports both built-in and plugin decoders (Lua + WASM).
Table of Contents
- Highlights
- Why turbohex
- Installation
- Basic Usage
- Keybindings
- Plugin Decoders
- Decoder Examples
- Development
- Dependencies
Highlights
- Fast TUI hex viewer with color-coded bytes and ASCII column
- Byte and bit-level selection modes
- Live decode panel (integers, floats, strings, timestamps, and more)
- Range-aware decode fields (
offset/length) with byte highlighting - Decoder focus with
Tab/Shift+Taband visual markers in hex view - Little-endian / big-endian toggle
- Built-in + plugin decoders with runtime enable/disable settings
- Memory-mapped I/O for large files
Why turbohex
xxd and hexdump are excellent for quick dumps and scripting, but they are
static output tools. turbohex is built for interactive reverse engineering and
protocol inspection.
- Interactive cursoring and selection (byte and bit modes)
- Live decode panel that updates as selection changes
- Field-to-byte mapping via
offset/lengthhighlighting - Endianness toggling and decoder focus/navigation in the UI
- Extensible decoders with Lua and WASM plugins
vs Other Hex Viewers
Many hex viewers can inspect bytes well; turbohex is optimized for terminal-
native, decoder-driven analysis loops.
- Terminal-first workflow: no GUI dependency, fast startup, scriptable usage
- Interactive decoding: decode panel updates immediately as selection changes
- Field mapping: decoder
offset/lengthvalues highlight exact source bytes - Plugin ergonomics: lightweight Lua decoders plus high-performance WASM option
- LLM-friendly setup:
turbohex --skillsprovides agent-ready decoder ABI docs
Installation
Prerequisite: Rust toolchain (cargo, rustc).
# Build a release binary
# Run without installing
# Or install to your PATH
Basic Usage
# Open a file
# Open included sample/test data
# Show CLI help
Keybindings
| Key | Action |
|---|---|
| Arrow keys | Move cursor |
Page Up / Page Down |
Scroll one page |
Home / End |
Jump to start / end |
g |
Goto offset (hex 0x... or decimal) |
v |
Toggle select mode |
Esc |
Clear selection / cancel / clear decode focus |
b |
Toggle byte / bit mode |
e |
Toggle LE / BE |
d |
Open decoder settings (enable/disable decoders) |
Tab / Shift+Tab |
Focus next/previous decoded field |
[ / ] |
Shrink / grow decode panel |
? |
Show help |
q |
Quit |
Plugin Decoders
Place decoder files in:
~/.config/turbohex/decoders/
.luafiles are loaded as Lua decoders.wasmfiles are loaded as WASM decoders
LLM Agent Setup (--skills)
turbohex --skills prints a complete plugin development guide (Lua/WASM ABI,
parameter support, examples, and usage) designed to be pasted into an LLM agent
workflow.
Why this helps:
- Reduces back-and-forth by giving agents ABI details up front
- Improves decoder correctness (expected JSON fields and endian semantics)
- Makes outputs actionable with install/build instructions for decoder paths
- Keeps generated plugins aligned with turbohex UI behavior
# Print guide in terminal
# Save and attach/paste to an agent
Suggested agent prompt starter:
Use the attached turbohex skills guide to build a decoder plugin for <format>.
Target Lua (or WASM), return fields as {label, value, optional offset, optional length},
and include install/build steps for ~/.config/turbohex/decoders/.
Lua Decoder ABI
Create a .lua file with a global decode(bytes, endian, params) function:
Field contract:
label(string, required)value(string, required)offset(number, optional, 0-based from selection start)length(number, optional)
WASM Decoder ABI
WASM modules should export:
| Export | Signature | Purpose |
|---|---|---|
memory |
linear memory | Shared memory |
alloc |
(i32) -> i32 |
Allocate input/output bytes |
decode |
(ptr: i32, len: i32, endian: i32) -> i32 |
Return pointer to NUL-terminated JSON |
Endian values:
0= little-endian1= big-endian
Decode return JSON format:
Decoder Examples
| Path | Language | Description |
|---|---|---|
examples/wasm-decoder-rust/ |
Rust | File magic detection, entropy, byte stats |
examples/wasm-decoder-http/ |
Rust | HTTP/1.x request/response parser |
examples/wasm-decoder-c/ |
C | RGB/RGBA color decoder |
Build and install the Rust example:
Or manually:
Development
# Dev build
# Release build
# Run
Development Setup
- Rust toolchain (
cargo,rustc) - Developed with Claude Code
Dependencies
Feedback
If you find anything incorrect, unclear, or missing, or want to suggest a new feature, please open a GitHub issue or submit a pull request.