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  /1dump bytes
/BEbig-endian
/C:startstart address
/CP:ncode page to use for non-Unicode text
/D  or  /4dump doublewords (four-byte integers)
/E:endend address
/F:nnumeric base for values 16
/Hdisplay headers
/Iinclude a final summary line
/Jhighlight alternate lines
/K:nbytes per line
/LElittle-endian
/M:maxmaximum number of bytes to display
/ML:linesmaximum number of lines to dump
/N:flagsdisable features
/Ppage output
/Q  or  /8dump quadwords (eight-byte integers)
/UCuppercase hexadecimal addresses and values
/W  or  /2dump words (two-byte integers)
/Xuse control pictures for ASCII control characters
/Z:charset the replacement character0xB7
handlea handle returned by @BALLOC or @BLOAD

/F:n lets you specify the numeric base for displaying values. Legal values are:

/F:O  or  /F:8octal
/F:D  or  /F:10decimal
/F:S  or  /F:+signed decimal
/F:H  or  /F:16hexadecimal (the default)

Addresses are always shown in hexadecimal.


/N:flags disables features:

8do not show dashes between bytes of UTF-8 characters
Cno highlight
Ido not display the address field
Lomit the blank line at the end
Tdo 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:

bbytes
wwords
ddoublewords
qquadwords
kthousands of bytes
Kkilobytes (210 or 1,024 bytes)
mmillions of bytes
Mmegabytes (220 or 1,048,576 bytes)
gbillions of bytes
Ggigabytes (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