Utilities

Command line tools

mrcdump

Examine the contents of a file as hexadecimal.

usage: mrcdump [-h] [--recursive] [--no-offsets] [--no-glyphs] [--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

--recursive, -r
 Read all files under each directory, recursively
--no-offsets, -O
 Don’t render line offsets
--no-glyphs, -G
 Don’t render the glyph map
--start, -C Start offset to read from (default: file start)
--end, -D End offset to stop reading at (default: file end)
--address-base, -R
 Base address to use for labelling (default: start)
--length, -n Length to read in (optional replacement for –end)
--major-len, -J
 Number of hexadecimal groups per line (default: 8)
--minor-len, -N
 Number of bytes per hexadecimal group (default: 4)
--plain, -p Disable ANSI colour formatting
--version, -V show program’s version number and exit

mrcgrep

Display the contents of a file that matches a regular expression pattern.

usage: mrcgrep [-h] [--recursive] [--fixed-string] [--hex-format]
               [--ignore-case] [--encoding ENCODING] [--before INT]
               [--after INT] [--format {hex,text,json}] [--start INT]
               [--end INT] [--address-base INT] [--length INT]
               [--major-len INT] [--minor-len INT] [--plain] [--version]
               PATTERN FILE [FILE ...]

Positional Arguments

PATTERN Pattern to match
FILE File to inspect

Named Arguments

--recursive, -r
 Read all files under each directory, recursively
--fixed-string, -F
 Interpret PATTERN as fixed string (disable regular expressions)
--hex-format, -H
 Interpret strings in PATTERN as hexadecimal
--ignore-case, -i
 Perform a case-insensitive search
--encoding, -e Convert strings in PATTERN to a specific Python encoding (default: utf8)
--before, -B Number of lines preceeding a match to show (default: 2)
--after, -A Number of lines following a match to show (default: 2)
--format, -f

Possible choices: hex, text, json

Output format (default: hex)

--start, -C Start offset to read from (default: file start)
--end, -D End offset to stop reading at (default: file end)
--address-base, -R
 Base address to use for labelling (default: start)
--length, -n Length to read in (optional replacement for –end)
--major-len, -J
 Number of hexadecimal groups per line (default: 8)
--minor-len, -N
 Number of bytes per hexadecimal group (default: 4)
--plain, -p Disable ANSI colour formatting
--version, -V 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, -B Number of lines preceeding a match to show (default: 2)
--after, -A Number of lines following a match to show (default: 2)
--all, -a Show all lines
--start, -C Start offset to read from (default: file start)
--end, -D End offset to stop reading at (default: file end)
--address-base, -R
 Base address to use for labelling (default: start)
--length, -n Length to read in (optional replacement for –end)
--major-len, -J
 Number of hexadecimal groups per line (default: 8)
--minor-len, -N
 Number of bytes per hexadecimal group (default: 4)
--plain, -p Disable ANSI colour formatting
--version, -V show program’s version number and exit

mrchist

Display the contents of a file as a histogram map.

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

Positional Arguments

FILE File to inspect

Named Arguments

--samples, -s Number of samples per histogram slice (default: 65536)
--summary, -m Show a single histogram for the full range instead of slices
--width, -W Histogram width (default: 64)
--height, -H Histogram height (default: 12)
--recursive, -r
 Read all files under each directory, recursively
--version, -V show program’s version number and exit
--start, -C Start offset to read from (default: file start)
--end, -D End offset to stop reading at (default: file end)
--address-base, -R
 Base address to use for labelling (default: start)
--length, -n Length to read in (optional replacement for –end)

mrcpix

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

usage: mrcpix [-h] [--recursive] [--width INT] [--version] [--start INT]
              [--end INT] [--address-base INT] [--length INT]
              FILE [FILE ...]

Positional Arguments

FILE File to inspect

Named Arguments

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