Utilities

Command line tools

mrcdump

Examine the contents of a file as hexadecimal.

usage: mrcdump [-h] [-r] [--no-hexdump] [--no-stats] [--hist-w HIST_W]
               [--hist-h HIST_H] [--start INT] [--end INT]
               [--address-base INT] [--length INT] [--major-len INT]
               [--minor-len INT] [--plain] [--version]
               FILE [FILE ...]

Positional Arguments

FILE File to inspect

Named Arguments

-r, --recursive
 Read all files under each directory, recursively
--no-hexdump Don’t render a hex dump
--no-stats Don’t render statistics
--hist-w Histogram width (default: 64)
--hist-h Histogram height (default: 12)
--start Start offset to read from (default: file start)
--end End offset to stop reading at (default: end)
--address-base Base address to use for labelling (default: start)
--length Length to read in (optional replacement for –end)
--major-len Number of hexadecimal groups per line (default: 8)
--minor-len Number of bytes per hexadecimal group (default: 4)
--plain Disable ANSI colour formatting
--version show program’s version number and exit

mrcgrep

Display the contents of a file that match a pattern.

usage: mrcgrep [-h] [-r] [-F] [-H] [-i] [--encoding ENCODING] [--start INT]
               [--end INT] [--length INT] [--before INT] [--after INT]
               [--no-hexdump] [--version]
               PATTERN FILE [FILE ...]

Positional Arguments

PATTERN Pattern to match
FILE File to inspect

Named Arguments

-r, --recursive
 Read all files under each directory, recursively
-F, --fixed-string
 Interpret PATTERN as fixed string (disable regular expressions)
-H, --hex-format
 Interpret strings in PATTERN as hexadecimal
-i, --ignore-case
 Perform a case-insensitive search
--encoding Convert strings in PATTERN to a specific Python encoding (default: utf8)
--start Start offset to read from (default: file start)
--end End offset to stop reading at (default: end)
--length Length to read in (optional replacement for –end)
--before Number of lines preceeding a match to show (default: 2)
--after Number of lines following a match to show (default: 2)
--no-hexdump Don’t render a hex dump
--version show program’s version number and exit

For convenience, mrcgrep will interpret the pattern as UTF-8 and convert it to the bytes equivalent in the encoding you specify.

It is important to note when writing regular expressions, single character matches and counts are done at the encoded byte level, not at the UTF-8 level! This can lead to unexpected side-effects for rules, e.g. the pattern “[ů]” will translate to “[xc5xaf]”, which matches either the first or second byte. If you’re unsure, write your expressions using escaped hexadecimal bytes (e.g. “[xNN]”).

mrcdiff

Compare the contents of two files as hexadecimal.

usage: mrcdiff [-h] [--before INT] [--after INT] [--all] [--start INT]
               [--end INT] [--address-base INT] [--length INT]
               [--major-len INT] [--minor-len INT] [--plain] [--version]
               FILE1 FILE2

Positional Arguments

FILE1 File to inspect
FILE2 File to compare against

Named Arguments

--before Number of lines preceeding a match to show (default: 2)
--after Number of lines following a match to show (default: 2)
--all Show all lines
--start Start offset to read from (default: file start)
--end End offset to stop reading at (default: end)
--address-base Base address to use for labelling (default: start)
--length Length to read in (optional replacement for –end)
--major-len Number of hexadecimal groups per line (default: 8)
--minor-len Number of bytes per hexadecimal group (default: 4)
--plain Disable ANSI colour formatting
--version show program’s version number and exit

mrchist

Display the contents of a file as a histogram map.

usage: mrchist [-h] [--start INT] [--end INT] [--address-base INT]
               [--length INT] [--samples INT] [--width INT] [-r] [--version]
               FILE [FILE ...]

Positional Arguments

FILE File to inspect

Named Arguments

--start Start offset to read from (default: file start)
--end End offset to stop reading at (default: end)
--address-base Base address to use for labelling (default: start)
--length Length to read in (optional replacement for –end)
--samples Number of samples per histogram slice (default: 65536)
--width Histogram width (default: 64)
-r, --recursive
 Read all files under each directory, recursively
--version show program’s version number and exit

mrcpix

Display the contents of a file as a 256 colour image.

usage: mrcpix [-h] [--start INT] [--end INT] [--length INT] [--width INT] [-r]
              [--version]
              FILE [FILE ...]

Positional Arguments

FILE File to inspect

Named Arguments

--start Start offset to read from (default: file start)
--end End offset to stop reading at (default: end)
--length Length to read in (optional replacement for –end)
--width Image width (default: 64)
-r, --recursive
 Read all files under each directory, recursively
--version show program’s version number and exit