xref: /freebsd/share/man/man9/hexdump.9 (revision a61f15043cb6d4574e5c0d1ac0f0157aaaaa7614)
14fb638c3SScott Long.\" -*- nroff -*-
24fb638c3SScott Long.\"
34fb638c3SScott Long.\" Copyright (c) 2003 Scott Long
44fb638c3SScott Long.\"
54fb638c3SScott Long.\" All rights reserved.
64fb638c3SScott Long.\"
74fb638c3SScott Long.\" This program is free software.
84fb638c3SScott Long.\"
94fb638c3SScott Long.\" Redistribution and use in source and binary forms, with or without
104fb638c3SScott Long.\" modification, are permitted provided that the following conditions
114fb638c3SScott Long.\" are met:
124fb638c3SScott Long.\" 1. Redistributions of source code must retain the above copyright
134fb638c3SScott Long.\"    notice, this list of conditions and the following disclaimer.
144fb638c3SScott Long.\" 2. Redistributions in binary form must reproduce the above copyright
154fb638c3SScott Long.\"    notice, this list of conditions and the following disclaimer in the
164fb638c3SScott Long.\"    documentation and/or other materials provided with the distribution.
174fb638c3SScott Long.\"
184fb638c3SScott Long.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
194fb638c3SScott Long.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
204fb638c3SScott Long.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
214fb638c3SScott Long.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
224fb638c3SScott Long.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
234fb638c3SScott Long.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
244fb638c3SScott Long.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
254fb638c3SScott Long.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
264fb638c3SScott Long.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
274fb638c3SScott Long.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
284fb638c3SScott Long.\"
294fb638c3SScott Long.\" $FreeBSD$
304fb638c3SScott Long.\"
314fb638c3SScott Long.Dd December 7, 2003
324fb638c3SScott Long.Os
334fb638c3SScott Long.Dt HEXDUMP 9
344fb638c3SScott Long.Sh NAME
354fb638c3SScott Long.Nm hexdump
36a61f1504SPeter Pentchev.Nd "Dump a block of bytes to the console in hexadecimal form"
374fb638c3SScott Long.Sh SYNOPSIS
384fb638c3SScott Long.In sys/systm.h
394fb638c3SScott Long.Ft void
404fb638c3SScott Long.Fn hexdump "void *ptr" "int length" "const char *hdr" "int flags"
414fb638c3SScott Long.Sh DESCRIPTION
42a61f1504SPeter PentchevHexdump prints an array of bytes to the console in hexadecimal form, along with
434fb638c3SScott Longthe ASCII representation of the bytes, if possible.  By default, each line of
44a61f1504SPeter Pentchevoutput will start with an offset count, followed by 16 hexadecimal values,
454fb638c3SScott Longfollowed by 16 ASCII characters.
464fb638c3SScott Long.Bl -tag -width 6n
474fb638c3SScott Long.It Fa ptr
484fb638c3SScott LongPointer to the array of bytes to print.  It does not need to be NULL-terminated.
494fb638c3SScott Long.It Fa length
504fb638c3SScott LongNumber of bytes to print
514fb638c3SScott Long.It Fa hdr
524fb638c3SScott LongPointer to a NULL-terminated character string that will be prepended to each
534fb638c3SScott Longline of output.  A value of NULL implies that no header will be printed.
544fb638c3SScott Long.It Fa flags
554fb638c3SScott LongFlags for controlling the formatting of the output
564fb638c3SScott Long.Bl -tag -width HD_OMIT_COUNT
574fb638c3SScott Long.It Fa Bits 0-7
584fb638c3SScott LongInteger value of the number of bytes to display on each line.  A value of 0
594fb638c3SScott Longimplies that the default value of 16 will be used.
604fb638c3SScott Long.It Fa Bits 8-15
61a61f1504SPeter PentchevCharacter ASCII value to use as the separator for the hexadecimal output.  A
624fb638c3SScott Longvalue of 0 implies that the default value of 32 (ASCII space) will be used.
634fb638c3SScott Long.It Fa HD_OMIT_COUNT
644fb638c3SScott LongDon't print the offset column at the beginning of each line
654fb638c3SScott Long.It Fa HD_OMIT_HEX
66a61f1504SPeter PentchevDon't print the hexadecimal values on each line.
674fb638c3SScott Long.It Fa HD_OMIT_CHARS
684fb638c3SScott LongDon't print the character values on each line.
694fb638c3SScott Long.El
704fb638c3SScott Long.El
714fb638c3SScott Long.Pp
724fb638c3SScott Long.Sh SEE ALSO
734fb638c3SScott Long.Xr ascii 7
744fb638c3SScott Long.Sh AUTHORS
754fb638c3SScott LongThis man page was written by
764fb638c3SScott Long.An Scott Long .
77