dead-ringer

March 1, 2026 ยท View on GitHub

Build

dead-ringer

A Rust-based command-line utility designed to compare two binary files, displaying differences by showcasing both hexadecimal and ASCII representations of the differing bytes.

demo

Features

  • CLI Diff Viewer for Hex and ASCII.
  • Color highlighting for different data types to enhance readability.
  • Keyboard navigation enables interactive exploration of differences.
  • Search for hex byte sequences (/) or ASCII strings (?), with n/N to cycle through matches.
  • Displays byte offset for focused data, aiding in precise location identification.

Installation

cargo install dead-ringer

Usage

Usage: dring <file1> <file2>

Arguments:
  <file1>  Path to the first binary file
  <file2>  Path to the second binary file

What is displayed: For differing bytes at the same offset, the diff shows the byte from the first file. When the files differ in length, extra bytes from the longer file are shown.

Keybindings

KeyAction
h/j/k/l or arrow keysNavigate
/Search by hex bytes
?Search by ASCII string
EnterSubmit search
TabToggle between hex/ASCII search
nNext match
NPrevious match
vEnter visual selection mode
yCopy selection as hex (OSC 52)
YCopy selection as ASCII (OSC 52)
EscCancel search / selection
qQuit

Clipboard (tmux)

Copy to clipboard uses the OSC 52 escape sequence, which works natively in most modern terminals (iTerm2, kitty, foot, WezTerm, etc.). If you run inside tmux 3.3+, add the following to ~/.tmux.conf so the sequence is forwarded to the outer terminal:

set -g allow-passthrough on

Then reload with tmux source-file ~/.tmux.conf.

Examples

The examples/ directory contains pre-built binary file pairs for testing:

cargo run -- examples/simple_v1.bin examples/simple_v2.bin
cargo run -- examples/firmware_v1.bin examples/firmware_v2.bin

See examples/README.md for the full list of test pairs.

Color Reference

Type of ByteColor
NULL#555753 Gray
OFFSET#555753 Gray
ASCII Printable#06989a Cyan
ASCII Whitespace#4e9a06 Green
ASCII Other#4e9a06 Green
Non-ASCII#c4a000 Yellow

Alternatives

If you're looking for a full-featured Hex/ASCII viewer, check out Hexyl!