BBDUMP — Dump a binary buffer to
standard output as hex.
Syntax:
BBDUMP /B /BE /C: /CP: /D /E: /F: /H /I /J /K: /LE /M: /ML: /N: /P /Q /UC /W /X /Z: handle…
/B or /1 | dump bytes | ✔ |
/BE | big-endian | |
/C:start | start address | |
/CP:n | code page to use for non-Unicode text | |
/D or /4 | dump doublewords (four-byte integers) | |
/E:end | end address | |
/F:n | numeric base for values | 16 |
/H | display headers | |
/I | include a final summary line | |
/J | highlight alternate lines | |
/K:n | bytes per line | |
/LE | little-endian | ✔ |
/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) | |
/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 |
| handle | a handle returned by @BALLOC or @BLOAD |
/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 |
C | no highlight |
I | do not display the address field |
L | omit the blank line at the end |
T | do not display the text field (i.e. characters) |
/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.
/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 BBDUMP normally would not do so: when output
is redirected or piped, e.g. piping to LIST.
/ML:lines
lets you set a maximum number of data lines to dump. Any header or summary lines
are not counted.
/CP:n
specifies the code page to use for non-Unicode text. If you do not specify any
/CP:n, the default behavior is to show
only ASCII characters. (Binary buffers, after all, are often used for things
other than text….)
/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.
rem Load and dump a file:
set bbuf=%@bload[build.txt]
bbdump /hh /i /x %bbuf
set rv=%@bfree[%bbuf] & unset bbuf