Personal fork of Hexxy, with better execution speed.
Find a file
Alexandre ZANNI f886ef0986
fix name
2024-02-15 12:03:27 +01:00
assets [hexxy] update readme 2024-02-01 16:34:13 -09:00
color.go [hexxy] move dev to main and remove unused functions 2024-02-01 16:22:54 -09:00
encode.go [hexxy] DEV branch - extremely speed up hex encoding 2024-02-01 15:12:24 -09:00
go.mod [hexxy] init 2024-01-15 14:42:30 -09:00
go.sum [hexxy] init 2024-01-15 14:42:30 -09:00
hexxy.go [hexxy] DEV branch - extremely speed up hex encoding 2024-02-01 16:23:15 -09:00
README.md fix name 2024-02-15 12:03:27 +01:00
reverse.go [hexxy] DEV branch - extremely speed up hex encoding 2024-02-01 15:12:24 -09:00

A modern alternative to `xxd` and `hexdump`

example of hexxy in action

Quick install

requirements: Go 1.20+ (it may build with earlier versions as well but I have not tested them) and git

git clone https://github.com/sweetbbak/hexxy && cd hexxy
go build

On ArchLinux (hexxy-git), e.g.:

pikaur -S hexxy-git

Example usage

# normal usage
hexxy /path/to/file.bin

# output without color
hexxy --no-color /path/to/file.bin

# read from stdin
cat mybinary | hexxy

# display plain output
hexxy -p file.bin

# Include a binary as a C variable
hexxy -i input-file > output.c

# Use plain non-formatted output
hexxy -p input-file

# crunch empty lines with a '*' and use uppercase HEX
hexxy -a --upper input-file

# Reverse plain non-formatted output (reverse plain)
hexxy -rp input-file

# Show output with a space in between N groups of bytes
hexxy -g1 input-file ... -> outputs: 00000000: 0f 1a ff ff 00 aa

# display offset in Decimal format
hexxy -td file.bin

# display offset in Octal format
hexxy -to file.bin

Performance

zk is a 17mb binary

xxd -i ~/bin/zk &> /dev/null  0.66s user 0.02s system 99% cpu 0.677 total
hexxy -i ~/bin/zk &> /dev/null  0.16s user 0.01s system 98% cpu 0.165 total
# plain XXD
xxd ~/bin/zk &> /dev/null  0.12s user 0.01s system 99% cpu 0.126 total

# hexxy without color
hexxy -N ~/bin/zk &> /dev/null  0.21s user 0.01s system 100% cpu 0.223 total

# hexxy with color
hexxy ~/bin/zk &> /dev/null  0.37s user 0.01s system 99% cpu 0.383 total

Credits

thanks to felixge for showing how this is done quickly thanks to igoracmelo for the idea to colorize hexdump output with a gradient