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 43d5a8819cSHiten Pandyathe ASCII representation of the bytes, if possible. 44d5a8819cSHiten PandyaBy default, each line of 45a61f1504SPeter Pentchevoutput will start with an offset count, followed by 16 hexadecimal values, 464fb638c3SScott Longfollowed by 16 ASCII characters. 474fb638c3SScott Long.Bl -tag -width 6n 484fb638c3SScott Long.It Fa ptr 49d5a8819cSHiten PandyaPointer to the array of bytes to print. 50d5a8819cSHiten PandyaIt does not need to be NULL-terminated. 514fb638c3SScott Long.It Fa length 524fb638c3SScott LongNumber of bytes to print 534fb638c3SScott Long.It Fa hdr 544fb638c3SScott LongPointer to a NULL-terminated character string that will be prepended to each 55d5a8819cSHiten Pandyaline of output. 56d5a8819cSHiten PandyaA value of NULL implies that no header will be printed. 574fb638c3SScott Long.It Fa flags 584fb638c3SScott LongFlags for controlling the formatting of the output 594fb638c3SScott Long.Bl -tag -width HD_OMIT_COUNT 604fb638c3SScott Long.It Fa Bits 0-7 61d5a8819cSHiten PandyaInteger value of the number of bytes to display on each line. 62d5a8819cSHiten PandyaA value of 0 implies that the default value of 16 will be used. 634fb638c3SScott Long.It Fa Bits 8-15 64d5a8819cSHiten PandyaCharacter ASCII value to use as the separator for the hexadecimal output. 65d5a8819cSHiten PandyaA value of 0 implies that the default value of 32 (ASCII space) will be used. 664fb638c3SScott Long.It Fa HD_OMIT_COUNT 674fb638c3SScott LongDon't print the offset column at the beginning of each line 684fb638c3SScott Long.It Fa HD_OMIT_HEX 69a61f1504SPeter PentchevDon't print the hexadecimal values on each line. 704fb638c3SScott Long.It Fa HD_OMIT_CHARS 714fb638c3SScott LongDon't print the character values on each line. 724fb638c3SScott Long.El 734fb638c3SScott Long.El 744fb638c3SScott Long.Pp 754fb638c3SScott Long.Sh SEE ALSO 764fb638c3SScott Long.Xr ascii 7 774fb638c3SScott Long.Sh AUTHORS 784fb638c3SScott LongThis man page was written by 794fb638c3SScott Long.An Scott Long . 80