rz-diff - Man Page
Compare files and find binary differences.
Synopsis
rz-diff | [OPTIONS] file0 file1 |
Description
rz-diff compares two files or binary programs and highlights the differences between them. It supports diffing different aspects like raw bytes, text lines, functions, sections, strings, etc., based on the options used.
- -A
compare virtual addresses from file0 with physical addresses in file1.
- -a [arch]
specify the architecture plugin to use for analysis (e.g., x86, arm).
- -b [bits]
specify the register size for the chosen architecture (e.g., 16, 32, 64).
- -B
run 'aaa' when loading the binary.
- -C
disable the use of colors in the output.
- -d [algo]
compute the edit distance between files using the chosen algorithm:
myers | Eugene W. Myers' O(ND) algorithm (no substitution)
leven | Levenshtein O(N^2) algorithm (with substitution
ssdeep | Context triggered piecewise hashing comparison- -e [k=v]
set an evaluable config variable.
- -H
enable hexadecimal visual mode for comparing files in hexadecimal format.
- -h
display the help message.
- -i
use command line arguments instead of files (only for -d).
- -j
output the comparison results in JSON format.
- -q
generate quiet output with minimal information.
- -0 [cmd]
input for file0 when option -t 'commands' is given.
- -1 [cmd]
input for file1 when option -t 'commands' is given.
- -S [WxH]
set the width and height of the terminal for visual mode.
- -t [type]
compute the difference between two files based on the specified type:
bytes | Compares raw bytes in the files (only for small files)
lines | Compares text files
functions | Compares functions found in the files
classes | Compares classes found in the files
command | Compares command output returned when executed in both files
| Requires -0 <cmd>, -1 <cmd> is optional
entries | Compares entries found in the files
fields | Compares fields found in the files
graphs | Compares 2 functions and outputs in graphviz/dot format
| Requires -0 <fcn name|offset>, -1 <fcn name|offset> is optional
imports | Compares imports found in the files
libraries | Compares libraries found in the files
sections | Compares sections found in the files
strings | Compares strings found in the files
symbols | Compares symbols found in the files- -T
show timestamp information in the output.
- -v
show version information for rz-diff.
palette colors can be changed by adding the following lines
inside the $HOME/.rizinrc file
ec diff.unknown blue | offset color
ec diff.match green | match color
ec diff.unmatch red | mismatch color
Example
Compare two binary files using the default settings:
rz-diff file1.bin file2.bin
Compare two text files and display the output in JSON format:
rz-diff -j -t lines file1.txt file2.txt
Compare two functions from an architecture plugin:
rz-diff -t graphs -0 function1 -1 function2 binary1 binary2
See Also
rizin(1), rz-find(1), rz-hash(1), rz-bin(1), rz-asm(1), rz-gg(1), rz-run(1), rz-ax(1),
Authors
pancake <pancake@nopcode.org>
Sohail <sksohail.swaraj@gmail.com>
Referenced By
rizin(1), rz-asm(1), rz-ax(1), rz-bin(1), rz-find(1), rz-gg(1), rz-hash(1), rz-run(1), rz-sign(1).