Bug 53242 - hexdumps in word mode are hardly readable
Summary: hexdumps in word mode are hardly readable
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: util-linux
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Elliot Lee
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-09-05 12:46 UTC by Rick van Rein
Modified: 2007-04-18 16:36 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-09-05 12:46:12 UTC
Embargoed:


Attachments (Terms of Use)

Description Rick van Rein 2001-09-05 12:46:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686)

Description of problem:
Due to endianity, a hexdump of words usually means the bytes in a file get
swapped around when hexdump prints words, in an order like 2211 4433
6655... which requires hopping over the numbers in a hard-to-do-well
scheme. Please allow for a byte-by-byte hexdump option in addition to
current dumping options; hexdumps can now only made per word.


How reproducible:
Always

Steps to Reproduce:
bash$ uname -m
i586
bash$ echo "ABCD" | hexdump
bash$  echo -n "ABCD" | hexdump
0000000 4241 4443
0000004
bash$ 

Actual Results:  See what I entered between the commandlines.

Expected Results:  bash$  echo -n "ABCD" | hexdump
0000000 41 42 43 44
0000004
bash$ echo -n "ABCD" | hexdump -x
0000000    4241    4443
0000004


Additional info:

The -x option now is doing nothing, it just confirms the default
word-printing.
Perhaps the default should be byte-by-byte, to make the hexdump more
trustworthy
when parsing files?

Application I was working on: mastering the format of PGP files, as
specified in RFC2440.
In the past, the same problem showed up when parsing DNS message packets.

Comment 1 Elliot Lee 2002-01-04 18:17:56 UTC
You can do all this with format strings.

A crude example:
hexdump -e '8/1 "%02x " "\n"' /foo/bar

If you want an option added to make this more convenient, please talk to the
util-linux maintainers (util-linux.no). I would guess that there is not
a huge demand for it


Note You need to log in before you can comment on or make changes to this bug.