Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
HEXWORDS(1)			mpatrol	library			   HEXWORDS(1)

       hexwords	 -  extracts  any words	from a file that can be	written	as hex

       hexwords	[options] [dictfile]

       The hexwords command is a little	tool that  can	be  used  to  generate
       hexadecimal constants from a dictionary of known	words.	Such numerical
       constants can be	used in	source files for a variety of debugging	 prob-
       lems, and problems with uninitialised variables are especially relevant
       since these special numbers will	stand out if seen from within a	debug-
       ger.  For example, here are some	common (and some not-so-common)	32-bit
       hexadecimal constants that can be used as debugging aids:

	   word	  hex constant
       addedbad	  0xaddedbad
       allocate	  0xa110ca7e
       badlabel	  0xbad1abe1
       baseball	  0xba5eba11
       codebabe	  0xc0debabe
       codedbad	  0xc0dedbad
       deadbeef	  0xdeadbeef
       deadcode	  0xdeadc0de
       failsafe	  0xfa115afe
       feedface	  0xfeedface
       freedata	  0xf4eeda7a
       goodcode	  0x600dc0de

       As can be seen above, many decimal digits can be	used to	represent  the
       letters	that  they  most  closely resemble, along with the hexadecimal
       digits A	through	F.  This provides a much  larger  selection  of	 words
       that  can be matched, although the digits 3 and 8 cannot	be used	due to
       the lack	of any similar-looking letters.	 The digits and	 their	corre-
       sponding	letters	are given in the following table.

       digit   letter
       0       O, o or Q
       1       I, i or l
       2       Z or z
       3       -
       4       q or R
       5       S or s
       6       G
       7       J or T
       8       -
       9       g
       A-F     A-F
       a-f     a-f

       The  dictfile argument must be a	valid dictionary filename but if dict-
       file is omitted then hexwords will use /usr/dict/words as the  name  of
       the dictionary file to use.  If that cannot be found then hexwords will
       try /usr/lib/dict/words and /usr/share/dict/words.  The dictionary file
       must  be	 a  plain text file that contains one word per line, otherwise
       few to no words will be matched.

       The hexwords command currently makes use	of several UNIX	text  process-
       ing commands in order to	extract	the words and their hexadecimal	equiv-
       alents.	As a result, the hexwords command is only likely  to  work  on
       UNIX  platforms	or  on	systems	 which have the	necessary commands in-

       --help [-h]
	      Displays a quick-reference option	summary.

       --match <exact|lower|upper|any> [-m]
	      Sets the type of case-sensitivity	to use.	 A  setting  of	 exact
	      performs	a case-sensitive comparison of all of the words	in the
	      dictionary file and the hexadecimal digits, whereas a setting of
	      any does not.  The lower and upper settings convert the words in
	      the dictionary file to lower and upper case respectively	before
	      performing a case-sensitive comparison.  The default case-sensi-
	      tivity is	exact.

       --maximum <count> [-u]
	      Sets the maximum number of letters to match.  None of the	 hexa-
	      decimal  numbers	displayed will have any	more digits than this.
	      The default is 8.

       --minimum <count> [-l]
	      Sets the minimum number of letters to match.  None of the	 hexa-
	      decimal  numbers	displayed will have any	less digits than this.
	      The default is 4.

       --version [-V]
	      Displays the version number of the hexwords command.

       mpatrol(1), mprof(1), mptrace(1), mleak(1), mpsym(1), mpedit(1),	 libm-
       patrol(3), libmpalloc(3).

       The mpatrol manual and reference	card.

       Graeme S. Roy <>

       Copyright (C) 1997-2002 Graeme S. Roy <>

       This library is free software; you can redistribute it and/or modify it
       under the terms of the GNU Library General Public License as  published
       by  the	Free  Software Foundation; either version 2 of the License, or
       (at your	option)	any later version.

       This library is distributed in the hope that it	will  be  useful,  but
       WITHOUT	ANY  WARRANTY;	without	 even  the  implied  warranty  of MER-
       General Public License for more details.

       You  should  have received a copy of the	GNU Library General Public Li-
       cense along with	this library; if not, write to the Free	Software Foun-
       dation, Inc., 59	Temple Place, Suite 330, Boston, MA 02111-1307,	USA.

Release	1.4			8 January 2002			   HEXWORDS(1)


Want to link to this manual page? Use this URL:

home | help