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.Dt HEXDUMP 9 33*aa12cea2SUlrich Spörlein.Os 344fb638c3SScott Long.Sh NAME 354fb638c3SScott Long.Nm hexdump 36db79bbffSRuslan Ermilov.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 42db79bbffSRuslan ErmilovThe 43db79bbffSRuslan Ermilov.Fn hexdump 44db79bbffSRuslan Ermilovfunction prints an array of bytes to the console in hexadecimal form, along with 45db79bbffSRuslan Ermilovthe 46db79bbffSRuslan Ermilov.Tn ASCII 47db79bbffSRuslan Ermilovrepresentation of the bytes, if possible. 48d5a8819cSHiten PandyaBy default, each line of 49a61f1504SPeter Pentchevoutput will start with an offset count, followed by 16 hexadecimal values, 50db79bbffSRuslan Ermilovfollowed by 16 51db79bbffSRuslan Ermilov.Tn ASCII 52db79bbffSRuslan Ermilovcharacters. 53db79bbffSRuslan Ermilov.Bl -tag -width indent 544fb638c3SScott Long.It Fa ptr 55d5a8819cSHiten PandyaPointer to the array of bytes to print. 56db79bbffSRuslan ErmilovIt does not need to be 57db79bbffSRuslan Ermilov.Dv NUL Ns 58db79bbffSRuslan Ermilov-terminated. 594fb638c3SScott Long.It Fa length 60db79bbffSRuslan ErmilovNumber of bytes to print. 614fb638c3SScott Long.It Fa hdr 62db79bbffSRuslan ErmilovPointer to a 63db79bbffSRuslan Ermilov.Dv NUL Ns 64db79bbffSRuslan Ermilov-terminated character string that will be prepended to each 65d5a8819cSHiten Pandyaline of output. 66db79bbffSRuslan ErmilovA value of 67db79bbffSRuslan Ermilov.Dv NULL 68db79bbffSRuslan Ermilovimplies that no header will be printed. 694fb638c3SScott Long.It Fa flags 70db79bbffSRuslan ErmilovFlags for controlling the formatting of the output. 71db79bbffSRuslan Ermilov.Bl -tag -width ".Dv HD_OMIT_COUNT" 72db79bbffSRuslan Ermilov.It Bits 0-7 73d5a8819cSHiten PandyaInteger value of the number of bytes to display on each line. 74d5a8819cSHiten PandyaA value of 0 implies that the default value of 16 will be used. 75db79bbffSRuslan Ermilov.It Bits 8-15 76db79bbffSRuslan ErmilovCharacter 77db79bbffSRuslan Ermilov.Tn ASCII 78db79bbffSRuslan Ermilovvalue to use as the separator for the hexadecimal output. 79db79bbffSRuslan ErmilovA value of 0 implies that the default value of 32 80db79bbffSRuslan Ermilov.Tn ( ASCII 81db79bbffSRuslan Ermilovspace) will be used. 82db79bbffSRuslan Ermilov.It Dv HD_OMIT_COUNT 83db79bbffSRuslan ErmilovDo not print the offset column at the beginning of each line. 84db79bbffSRuslan Ermilov.It Dv HD_OMIT_HEX 85db79bbffSRuslan ErmilovDo not print the hexadecimal values on each line. 86db79bbffSRuslan Ermilov.It Dv HD_OMIT_CHARS 87db79bbffSRuslan ErmilovDo not print the character values on each line. 884fb638c3SScott Long.El 894fb638c3SScott Long.El 904fb638c3SScott Long.Sh SEE ALSO 914fb638c3SScott Long.Xr ascii 7 924fb638c3SScott Long.Sh AUTHORS 93571dba6eSHiten PandyaThis manual page was written by 944fb638c3SScott Long.An Scott Long . 95