The Graham Utilities for OS/2 - Version 2


[Warpspeed]

[Table of Contents] [Index] [Previous] [Next]


Hexdump - Dump a file in Hexadecimal format

Summary

Hexdump performs a hexadecimal dump of the specified file.

Icon

Command Line Format

Usage: Hexdump {Switches} <File Spec> Drive Spec(s)

Switches

-a
All disks.
-c
Clip the high bit.
-h
Hard disks only.
-s
Include subdirectories in the search.
-t
Open the file in TEXT mode. The default is BINARY.
-x
Xor the high bit.

Description

Hexdump will display the contents of files in hexadecimal. The file address is displayed in hexadecimal, as is the file data (in rows of 16 bytes in hexadecimal). An ASCII character representation of the bytes is also displayed on the right of the screen. Any unprintable characters are displayed as a period (".").

If both the -c and -x switches are specified together, the byte is first clipped (-c) and then XORed (-x). The effect of specifying both the -c and -x switches is the same as forcing the high bit on.

-a All disks

Hexdump will scan all logical disk drives defined by the system, starting at drive A:. The drives are scanned in order, starting at A:, then B: and so on.

-c Clip the high bit off

This switch strips off the high bit (bit 7) of all bytes which are read. A byte has the range of 0 to 255. This option limits the range to 0 to 127.

-h Hard disks only

Hexdump will scan all logical disk drives defined by the system, starting at drive C:. The drives are scanned in order, starting at C:, then D: and so on.

-s Subdirectories

Hexdump will include subdirectories as part of its search of the specified disk drives. If a subdirectory name is included as part of the file specification, then the search will include that subdirectory and all subdirectories below it. If no subdirectory is given as part of the file specification, then the current directory and all below it are included in the search.

-t Open the file in TEXT mode

The default mode of Hexdump is to open the file in BINARY mode. This means the entire file will be read. In TEXT or ASCII mode the file is opened as a text file. This means that the file will be read until the physical end of file, or an end of file character (26 decimal, Control-Z or 1A hex) is found.

-x Xor the high bit

This switch XORs the high bit (bit 7). All bytes from 0-127 (0-7F hex) will be changed to 128-255 (80-FF hex); and all bytes from 128-255 (80-FF hex) will be changed to 0-127 (0-7F hex).

Examples

HEXDUMP *.bin
Hexdump will dump any .bin files which it finds in the current directory.
HEXDUMP *.ico /s
Hexdump will dump any .ico files which it finds in the current directory - as well as any subdirectories below it.
HEXDUMP -c TEST.DOC
Hexdump the Word Star document TEST.DOC. Word Star documents have the high bit set to indicate the beginning of a word, so the -c switch has been specified.
HEXDUMP -x prime.dat
Hexdump will display the contents of the file 'prime.dat', after it has XORed bit 7. Some minicomputers (such as the Prime 50 Series) use a character set which is mapped in the upper 128 byte half of the complete 256 byte character set. The -x switch is useful for such files. It has the effect of making the ASCII portion of the dump more readable.