RZ_DIFF(1) | General Commands Manual | RZ_DIFF(1) |
NAME
RZ_DIFF
— 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:
-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
- Compare raw bytes in the files (only for small files)
lines
- Compare text files
functions
- Compare functions found in the files
classes
- Compare classes found in the files
command
- Compare command output returned when executed in both files. Requires -0 <cmd>, -1 <cmd> is optional.
entries
- Compare entries found in the files
fields
- Compare fields found in the files
graphs
- Compare 2 functions and outputs in graphviz/dot format. Requires -0 <fcnname|offset>, -1 <fcn name|offset> is optional.
imports
- Compare imports found in the files
libraries
- Compare libraries found in the files
sections
- Compare sections found in the files
strings
- Compare strings found in the files
symbols
- Compare symbols found in the files
-T
- Show timestamp information in the output
-V
- Show version information for rz-diff
-v
- be more verbose (stderr output)
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>
byteninjaa0
August 25, 2023 |