11eaf0ac3Slogwang.\" -*- nroff -*- 21eaf0ac3Slogwang.\" 31eaf0ac3Slogwang.\" Copyright (c) 2003 Scott Long 41eaf0ac3Slogwang.\" 51eaf0ac3Slogwang.\" All rights reserved. 61eaf0ac3Slogwang.\" 71eaf0ac3Slogwang.\" This program is free software. 81eaf0ac3Slogwang.\" 91eaf0ac3Slogwang.\" Redistribution and use in source and binary forms, with or without 101eaf0ac3Slogwang.\" modification, are permitted provided that the following conditions 111eaf0ac3Slogwang.\" are met: 121eaf0ac3Slogwang.\" 1. Redistributions of source code must retain the above copyright 131eaf0ac3Slogwang.\" notice, this list of conditions and the following disclaimer. 141eaf0ac3Slogwang.\" 2. Redistributions in binary form must reproduce the above copyright 151eaf0ac3Slogwang.\" notice, this list of conditions and the following disclaimer in the 161eaf0ac3Slogwang.\" documentation and/or other materials provided with the distribution. 171eaf0ac3Slogwang.\" 181eaf0ac3Slogwang.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 191eaf0ac3Slogwang.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 201eaf0ac3Slogwang.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 211eaf0ac3Slogwang.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 221eaf0ac3Slogwang.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 231eaf0ac3Slogwang.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 241eaf0ac3Slogwang.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 251eaf0ac3Slogwang.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 261eaf0ac3Slogwang.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 271eaf0ac3Slogwang.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 281eaf0ac3Slogwang.\" 291eaf0ac3Slogwang.\" $FreeBSD$ 301eaf0ac3Slogwang.\" 31*22ce4affSfengbojiang.Dd May 8, 2020 321eaf0ac3Slogwang.Dt HEXDUMP 3 331eaf0ac3Slogwang.Os 341eaf0ac3Slogwang.Sh NAME 351eaf0ac3Slogwang.Nm hexdump 361eaf0ac3Slogwang.Nd "dump a block of bytes to standard out in hexadecimal form" 371eaf0ac3Slogwang.Sh SYNOPSIS 381eaf0ac3Slogwang.In libutil.h 391eaf0ac3Slogwang.Ft void 401eaf0ac3Slogwang.Fn hexdump "void *ptr" "int length" "const char *hdr" "int flags" 411eaf0ac3Slogwang.Sh DESCRIPTION 421eaf0ac3SlogwangThe 431eaf0ac3Slogwang.Fn hexdump 441eaf0ac3Slogwangfunction prints an array of bytes to standard out in hexadecimal form, 45*22ce4affSfengbojiangalong with the ASCII representation of the bytes, if possible. 46*22ce4affSfengbojiangBy default, each line of output will start with an offset count, followed by 16 47*22ce4affSfengbojianghexadecimal values, followed by 16 ASCII characters. 481eaf0ac3Slogwang.Bl -tag -width indent 491eaf0ac3Slogwang.It Fa ptr 501eaf0ac3SlogwangPointer to the array of bytes to print. 511eaf0ac3SlogwangIt does not need to be 521eaf0ac3Slogwang.Dv NUL Ns 531eaf0ac3Slogwang-terminated. 541eaf0ac3Slogwang.It Fa length 551eaf0ac3SlogwangNumber of bytes to print. 561eaf0ac3Slogwang.It Fa hdr 571eaf0ac3SlogwangPointer to a 581eaf0ac3Slogwang.Dv NUL Ns 591eaf0ac3Slogwang-terminated character string that will be prepended to each 601eaf0ac3Slogwangline of output. 611eaf0ac3SlogwangA value of 621eaf0ac3Slogwang.Dv NULL 631eaf0ac3Slogwangimplies that no header will be printed. 641eaf0ac3Slogwang.It Fa flags 651eaf0ac3SlogwangFlags for controlling the formatting of the output. 661eaf0ac3Slogwang.Bl -tag -width ".Dv HD_OMIT_COUNT" 671eaf0ac3Slogwang.It Bits 0-7 681eaf0ac3SlogwangInteger value of the number of bytes to display on each line. 691eaf0ac3SlogwangA value of 0 implies that the default value of 16 will be used. 701eaf0ac3Slogwang.It Bits 8-15 71*22ce4affSfengbojiangCharacter ASCII value to use as the separator for the hexadecimal output. 721eaf0ac3SlogwangA value of 0 implies that the default value of 32 73*22ce4affSfengbojiang.Pq ASCII space 74*22ce4affSfengbojiangwill be used. 751eaf0ac3Slogwang.It Dv HD_OMIT_COUNT 761eaf0ac3SlogwangDo not print the offset column at the beginning of each line. 771eaf0ac3Slogwang.It Dv HD_OMIT_HEX 781eaf0ac3SlogwangDo not print the hexadecimal values on each line. 791eaf0ac3Slogwang.It Dv HD_OMIT_CHARS 801eaf0ac3SlogwangDo not print the character values on each line. 811eaf0ac3Slogwang.El 821eaf0ac3Slogwang.El 831eaf0ac3Slogwang.Sh SEE ALSO 841eaf0ac3Slogwang.Xr ascii 7 , 85*22ce4affSfengbojiang.Xr sbuf_hexdump 9 86*22ce4affSfengbojiang.Sh HISTORY 87*22ce4affSfengbojiangThe 88*22ce4affSfengbojiang.Fn hexdump 89*22ce4affSfengbojiangfunction first appeared in 90*22ce4affSfengbojiang.Fx 6.4 . 911eaf0ac3Slogwang.Sh AUTHORS 921eaf0ac3SlogwangThis manual page was written by 931eaf0ac3Slogwang.An Scott Long . 94