HexDump plugin for Take Command / TCC / TCC/LE
beta version 0.96.9 2025-08-21
Charles Dye
Purpose:
This plugin adds one new command, HEXDUMP,
which displays files or standard input to standard output as hexadecimal values.
This can be useful to study what kind of data is being sent, say, to a pipe;
to figure out how a file is encoded; or to snoop for strings in a binary
file.
There are a lot of hexdump utilities out there. This one supports Take
Command-style syntax: /A: to select files by attributes,
/S to search into subdirectories, /P to page
output, and so on. It also recognizes Unicode files including UTF-16 and
UTF-8, and displays Unicode characters in its text field.
HEXDUMP is fairly flexible in that it can display data as
bytes, words, or doublewords. Multibyte values may be either little-endian
or big-endian. You can display values in hexadecimal, octal, or decimal.
You can choose the number of bytes to display per line, or HEXDUMP
can pick its own line length based on the console size. You can suppress
the address field with /NI and the text field with
/NT.
Installation:
To use this plugin, copy HexDump.dll to
some known location on your hard drive. (If you are still using the 32-bit
version of Take Command, take HexDump-x86.dll
instead of HexDump.dll.) Load the .DLL file
with a PLUGIN /L command, for example:
plugin /l c:\bin\tcmd\test\hexdump.dll
If you copy the .DLL file to a subdirectory named PlugIns within your Take Command program directory, it will be loaded automatically when TCC starts.
Plugin Features:
| New Command | ||||
|---|---|---|---|---|
HEXDUMP | ||||
Syntax Note:
The syntax definitions in the following text use these conventions for clarity:
BOLD CODE | indicates text which must be typed exactly as shown. |
CODE | indicates optional text, which may be typed as shown or omitted. |
| Bold italic | names a required argument; a value must be supplied. |
| Regular italic | names an optional argument. |
| ellipsis… | after an argument means that more than one may be given. |
Examples are shown in a gray box:
rem This is an example:
hexdump /h /x build.txt
Some command options take an argument. These are shown with a colon between the
option and its argument: /A:arg
If you like, you may substitute an equals sign for the colon: /A=arg
This is handy if the arg is a filename, and you want to use tab completion to
enter the filename.
Or you can omit the colon: /Aarg
New Command:
HEXDUMP — Display files or
standard input to standard output as hex.
Syntax:
HEXDUMP /A:attr /B /BE /C:start /CP:n /D /E:end /F:n /H /HH /I /J /K:n /LE /M:max /ML:lines /N:flags /P /Q /S /U /W /X /Z:char filename…
/A:attr | filter by attributes | |
/B or /1 | dump bytes | ✔ |
/BE | big-endian | |
/C:start | start address | |
/CP:n | code page to use for non-Unicode text | |
/CR | use CR line ends | |
/CRLF | use CR/LF line ends | ✔ |
/D or /4 | dump doublewords (four-byte integers) | |
/E:end | end address | |
/F:n | numeric base for values | 16 |
/H | display filenames | |
/HH | display filenames, sizes, and text encodings | |
/I | include a final summary line | |
/J | highlight alternate lines | |
/K:n | bytes per line | |
/LE | little-endian | ✔ |
/LF | use LF line ends | |
/M:max | maximum number of bytes to display | |
/ML:lines | maximum number of lines to dump | |
/N:flags | disable features | |
/P | page output | |
/Q or /8 | dump quadwords (eight-byte integers) | |
/S | search into subdirectories for matching files | |
/U | Unixy mode | |
/UC | uppercase hexadecimal addresses and values | |
/W or /2 | dump words (two-byte integers) | |
/X | use control pictures for ASCII control characters | |
/Z:char | set the replacement character | 0xB7 |
Filenames may be specified on the command line, or text may be redirected
or piped into HEXDUMP. Wildcards, directory aliases, and
CLIP: are supported.
If you do not specify any filenames, HEXDUMP will read from
standard input. If standard input is not redirected from a file or pipe,
HEXDUMP will read from the keyboard; type Ctrl-Z
and then Enter to finish.
If you want to pipe to HEXDUMP, remember that pipes open a
new shell. You must either ensure that this plugin is loaded in the new
shell, e.g. by copying its .DLL file to the PlugIns
directory; or else use an in-process pipe with the |!
syntax.
/F:n
lets you specify the numeric base for displaying values. Legal values are:
/F:O or /F:8 | octal |
/F:D or /F:10 | decimal |
/F:S or /F:+ | signed decimal |
/F:H or /F:16 | hexadecimal (the default) |
Addresses are always shown in hexadecimal.
8 | do not show dashes between bytes of UTF-8 characters |
B | do not write a BOM (useful when redirecting to a Unicode file) |
C | no highlight |
D | do not search into hidden directories (with /S) |
F | suppress file-not-found error messages |
I | do not display the address field |
J | do not search into junctions (with /S) |
L | do not add a blank line at the end of each file |
Q | no fancy Unicode quotes in the header or summary lines |
T | do not display the text field (i.e. characters) |
U | do not display non-ASCII characters in the text field |
Z | do not search into system directories (with /S) |
/C:start,
/E:end, and
/M:max let you specify a start
address, an end address, and a maximum number of bytes to dump. You can
enter these values as decimal, or hexadecimal with a leading 0x.
You may give none, one, or any combination of these options.
/C:, /E:, and /M: values are
all in bytes by default. You can append one of the following letters:
b | bytes |
w | words |
d | doublewords |
q | quadwords |
k | thousands of bytes |
K | kilobytes (210 or 1,024 bytes) |
m | millions of bytes |
M | megabytes (220 or 1,048,576 bytes) |
g | billions of bytes |
G | gigabytes (230 or 1,073,741,824 bytes) |
Note that k K m M g and G are case-sensitive.
If you don’t give any of these suffixes, the value is in bytes — even if you are displaying words or doublewords. There are no alignment checks; you can dump misaligned data if you wish.
/C: and /E: allow you to pass a negative number to
specify the address as an offset from the end of the file, e.g. /C:-1K
to dump only the last kilobyte of the file. /M: does not allow
negative numbers.
/K:n
lets you specify the number of bytes to display per line. If you don’t
give any /K:, the command will pick its own value based on the
console width (if output is to the console), or a default line width of
100 characters if output is redirected. Again, this value is in bytes,
even if you are displaying data as words or doublewords. The value
n must be between 8 and 80, and a multiple of 8.
/K:0 sets the line length based on the console width, even
in cases where HEXDUMP normally would not do so: when output
is redirected or piped, e.g. piping to LIST; or in
Unixy mode.
/ML:n
lets you set a maximum number of data lines to dump. Any header or summary lines
are not counted.
/Z:char
lets you specify the replacement character, which is shown in the text
field in place of control characters. The default is normally a middle dot
· You may give either a literal character or a character value. All
three of the following are equivalent:
• /Z:* | (literal character) |
• /Z:42 | (decimal value) |
• /Z:0x2a | (hexadecimal value) |
Your replacement character may not be alphanumeric or a control
character. /Z by itself will use a space as the replacement
character.
/U selects Unixy mode: the
output format is adjusted to look more like hexdump utilities
found on various flavors of Unix. 16 bytes of data are displayed per line,
unless you set a diffent value with /K:n.
Multiple lines with the same data are replaced with a single asterisk.
The default replacement character is a period, unless you set a different
one with /Z:char.
/U only makes a few cosmetic adjustments to
HEXDUMP’s output format. Its basic operation is
unchanged, and the output may not be an exact match for any particular
Unix utility.
rem Dump the file Build.txt :
hexdump /hh /i /x build.txt
Reference Information:
| Size Limit | There is one, but it varies. |
| Paging Options | To /P, or not to /P ? |
| Highlight Variable | Choose your colors. |
| Startup Message | and how to suppress it |
| Changes | What’s new? |
| Status and Licensing |
Size Limit
HEXDUMP may fail on extremely large files (more than a
gigabyte or two). The exact upper limit will vary depending on your
processor type and Windows edition. X64 Windows will allow much larger
files than X86 Windows.
Paging Options:
HEXDUMP has a /P option to page
output. This option supports two suboptions:
/P:time,lines
| time | time in seconds, or (with a trailing M) milliseconds |
| lines | number of lines to display before pausing |
Both time and lines are optional. The colon is not required, but you must use the comma if you want to specify lines.
rem Scroll every five seconds:
hexdump test.bin /p:5
rem Display ten lines at a time:
hexdump test.bin /p:,10
rem Display twenty lines at a time, and
rem scroll every 2.5 seconds:
hexdump test.bin /p:2500m,20
At the “Press a key to continue” prompt, most keys will advance by another screenful (or lines). But a few keys behave differently:
| A or C | turns off paging, and scrolls continuously |
| Esc or Ctrl-C | aborts the current command |
| / | scrolls half a screen, or half of lines |
| 1 to 9 | scrolls that many lines, e.g. 3 scrolls three lines |
Highlight Variable:
HEXDUMP features highlighted output
when you enable either filename headers with /H or highlighted
alternate lines with /J. You can customize this feature by
setting an environment variable Highlight:
rem Disable highlight:
set highlight=none
rem Set the highlight foreground:
set highlight=bright cyan
rem Set both foreground and background:
set highlight=bri whi on blu
rem Numbers are also supported:
set highlight=46
If the Highlight environment variable is not defined, the plugin will
check the registry for a value named Highlight of type REG_SZ.
The plugin will search, in this order:
• HKEY_CURRENT_USER\Software\JPPlugins\HexDump | (affects this plugin only) |
• HKEY_CURRENT_USER\Software\JPPlugins | (affects several of my plugins) |
You can also use /NC to disable highlighting.
Startup Message:
This plugin displays an informational line when it initializes. The
message will be suppressed in transient or pipe shells. You can disable it
for all shells by defining an environment variable named NOLOADMSG,
for example:
set /e /u noloadmsg=1
Changes:
| 0.96.9.1 | 2025-08-21 | /C: /E: and
/M: now can combine a multiplier with a word size, e.g. /C:10KW
for 10 kilowords = 20,480 bytes. Additional sanity check/error message for EOF-relative start and end addresses. |
| 0.96.9.0 | 2025-08-20 | /C: and
/E: allow negative values to specify the starting/ending
address as an offset from the end of the file. |
| 0.96.8.9 | 2025-08-06 | VLFN display tweak: If the
filename has the \\?\ prefix, don’t display the prefix in the filename
header. |
| 0.96.8.8 | 2025-07-17 | Returns ERROR_INVALID_PARAMETER if no arguments are passed. (Can’t happen?) |
| 0.96.8.7 | 2025-07-07 | Removes the hex file size from the final summary line. It only cluttered the line without adding any new info. |
| 0.96.8.6 | 2025-07-02 | Pluralizes byte/bytes in the final
summary line. If WordLen > 1, shows the word size and word count instead of the hex file size in the final summary. |
| 0.96.8.5 | 2025-06-29 | In the /I summary line,
CLIP: and - were not being handled nicely; fixed. In the /H and /HH header line, use fancy Unicode quotes around the
filename of an actual file, as /I does. Removed hardcoded \r\n from header and summary lines; now they respect
/NL and /CR. Added /NQ to suppress the fancy Unicode quote marks. |
| 0.96.8.4 | 2025-06-15 | Added /BOM to display any
Byte Order Marks (anywhere in the file) as the generic currency symbol ¤. Fixed an
issue where an error in /ML: would exit without proper cleanup. |
| 0.96.8.3 | 2025-06-13 | Fixes to the handling of control pictures: Use the user’s specified replacement character if no control picture is available; use the correct control pic for DEL. |
| 0.96.8.0 | 2025-06-07 | Now MaxLines just adjusts EndAddress up front. Much simpler! |
| 0.96.7.0 | 2025-06-06 | Removed the redundant FirstLine variable. When MaxLines and Unixy mode are both set, fudge the end address so the final bytes-shown summary will be correct. |
| 0.96.6.0 | 2025-06-06 | Added /ML: to set a maximum
number of lines to dump. |
| 0.96.5.1 | 2025-05-07 | Unixy mode also disables the UTF-8 dashes. |
| 0.96.5 | 2025-05-07 | When dumping a UTF-8 text file by bytes, show
dashes between bytes of a valid character. Added /N8 to disable. Added support for the NO_COLOR environment
variable. If NO_COLOR is defined and HIGHLIGHT is not, disable highlighting
as if /D had been specified. |
| 0.96.4 | 2025-03-26 | Highlight the summary line. Updated conlist.cpp, mmfiles.cpp. |
| 0.96.3.1 | 2025-03-20 | Fixed incorrect buffer length in ShowFilenameHeader(). |
| 0.96.3 | 2025-03-17 | Added /X to use control pictures for
ASCII control characters. Fixed an issue which caused the text field to be lost if the final line overlapped the end of the buffer. Slightly simplified the ‘print word values’ loop. |
| 0.96.2 | 2025-01-10 | Added /F?. Added
/F:+ and /F:- as synonyms for /F:S. |
| 0.96.1.1 | 2025-01-01 | Uses CL_ConsoleHandle()
from conlist.cpp, instead of duplicating this function. Other
trivial code tweaks. |
| 0.96.1 | 2024-12-28 | Rewrote and simplified parsing of
/1 /2 /3 … /8. |
| 0.96.0 | 2024-12-21 | Added support for some oddball word sizes.
Added /CR, /CRLF, and /LF to select different end-of-line
characters. Added /UC to uppercase hex addresses and values. Removed the increasingly
Byzantine HexDump_ValWidth() and replaced it with a simple lookup table. |
| 0.95.0 | 2024-11-08 | Added /Q to dump quadwords.
Added /F:S to display values as signed decimal.
Simplified the data-dump code. |
| 0.94.4.1 | 2024-11-06 | Bug fix: PLUGIN_BUFFER_MAX is 32K bytes, not 32K characters. |
| 0.94.4 | 2024-09-19 | More /Z: tweaks: now the
replacement character may be specified by value. |
| 0.94.3.1 | 2024-09-18 | Tweaks to /Z: skip over a colon
or equals sign; do not allow multiple characters. |
| 0.94.3 | 2024-09-13 | Added /I to include a final summary
line with the number of bytes displayed. |
| 0.94.2 | 2024-09-09 | Added /NU to not display non-ASCII
characters. Modified /Z to allow the user to specify the replacement character. If no
/Z was given and either Unixy or ASCII-only mode is in effect, then the replacement character
defaults to period instead of mid-dot. |
| 0.94.1 | 2024-08-22 | Bug fix: the default HexWidth calculation was not correctly accounting for the width of the address field; fixed. |
| 0.94.0 | 2024-08-20 | Added /J to highlight alternate
lines. |
| 0.93.1 | 2024-08-19 | Added w W d D to the size_t parser
for words and doublewords. Added /$ for debug output. |
| 0.93.0 | 2024-08-17 | Wrote a separate parser for size_t arguments.
The numeric value may be suffixed with b B k K m M g G for bytes or decimal/binary
kilobytes, megabytes, etc. |
Status and Licensing:
Consider this beta software. It may well have issues. Try it at your own risk. If you find a problem, you can report it in the JP Software support forum.
HexDump is currently licensed only for testing purposes. I may make binaries and source code available under some free license once I consider it ready for use.
Download:
You can download the current version of this plugin from https://charlesdye.net/dl/hexdump.zip.