HEXDUMP(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– HEXDUMP(3) πŸ’–

okay so bestie, this page is from the Library Functions Manual, and it's about the libutil function that dumps a block of bytes to standard out in hexadecimal form. She's giving tiny forensic main character energy and honestly? obsessed. ✨

🌈 NAME 🌈

hexdump β€” dump a block of bytes to standard out in hexadecimal form

πŸ¦‹ LIBRARY πŸ¦‹

System Utilities Library β€” that's libutil, and you link it with -lutil. Slay.

🌸 SYNOPSIS 🌸

#include <libutil.h>

void
hexdump(void *ptr, int length, const char *hdr, int flags);

✨ DESCRIPTION ✨

The hexdump() function prints an array of bytes to standard out in hexadecimal form, along with the ASCII representation of the bytes, if possible. Default vibe: each line of output starts with an offset count, then 16 hexadecimal values, then 16 ASCII characters. No cap, that's the layout. πŸ’…

  • ptr β€” pointer to the array of bytes to print. It does not need to be NUL-terminated. She can be raw like that, fr fr.
  • length β€” number of bytes to print. Literally just how many bytes we're serving.
  • hdr β€” pointer to a NUL-terminated character string that will be prepended to each line of output. A value of NULL implies that no header will be printed. So if you pass NULL, the header said "not me being absent" πŸ™ˆ.
  • flags β€” flags for controlling the formatting of the output. Here's the breakdown, bestie:
    • Bits 0-7 β€” Integer value of the number of bytes to display on each line. A value of 0 implies that the default value of 16 will be used.
    • Bits 8-15 β€” Character ASCII value to use as the separator for the hexadecimal output. A value of 0 implies that the default value of 32 (ASCII space) will be used.
    • HD_OMIT_COUNT β€” Do not print the offset column at the beginning of each line. Bye offset column πŸ‘‹.
    • HD_OMIT_HEX β€” Do not print the hexadecimal values on each line.
    • HD_OMIT_CHARS β€” Do not print the character values on each line.

⭐ SEE ALSO ⭐

πŸŽ€ HISTORY πŸŽ€

The hexdump() function first appeared in FreeBSD 6.4. She's a classic, iykyk.

πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Scott Long. Respect the icon who wrote the docs. 🫢


And that's the tea: this page is from the Debian build, dated May 8, 2020 β€” periodt πŸ’…βœ¨

πŸ“¦ where this page comes from