Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


DumpFile

Tool

SYNTAX

DumpFile file [-a] [-a7] [-bf] [-g nn] [-h] [-noResolve] [-o] [-p]
[-r byte1[,byteN]] [-rf] [-w mm]

DESCRIPTION

The DumpFile tool disassembles and displays the contents of the resource or data fork of a file in a variety of formats. By default, DumpFile displays the file's data fork, but you can specify the -rf option to display the resource fork instead.

INPUT

An object file (file). DumpFile does not accept standard input.

OUTPUT

Standard output. DumpFile writes the contents of the resource or data fork of a file to standard output.

ALIAS RESOLUTION

This command resolves Finder aliases on all input file specifications unless you use the -noResolve option to dump the contents of a Finder alias file.

STATUS

DumpFile can return the following status codes:

0

no errors

1

syntax error

2

fatal error

PARAMETERS

file

Specifies the object file.

OPTIONS

Numeric values for options can be specified as decimal constants (no prefix required), hexadecimal numbers (using a '$' or '0x' prefix), octal numbers (with a '0' prefix), or binary numbers (with a '0b' prefix).

-a

Suppresses the display of ASCII character values.

-a7

Ignores the high-order bit when displaying ASCII character values.

-bf

Displays both forks (resource and data) of the file.

-g nn

Groups nn bytes together without intervening spaces. Normally each byte is separate (nn = 01).

-h

Suppresses the display of hexadecimal characters.

-noResolve

Suppresses leaf alias resolution on the input file pathname so you can dump the contents of a Finder alias file.

-o

Suppresses the display of file offsets.

-p

Writes progress information, such as the name of the file being dumped and the version of DumpFile to diagnostic output.

-r byte1[,byteN]

Displays only the byte range byte1 to byteN. Normally DumpFile displays all bytes. If you omit byteN, DumpFile dumps the rest of the file.

The -r option accepts negative numbers which are treated as offsets from the end of the fork. For example, to dump the last 100 bytes of the data fork you can specify
DumpFile myfile -r -100
To dump the second to last block of the fork you can specify
DumpFile myfile -r -1024,-513

-rf

Displays the resource fork of the file. Normally the data fork is displayed.

-w mm

Displays output lines of mm width, where mm is the number of bytes. Output lines are normally 16 bytes wide. The maximum linewidth is 4096 bytes.

Note
If you use -g in conjunction with this option, mm must be a multiple of the nn value from -g. •

EXAMPLES

The following command line displays the data fork of the file Count.c.

DumpFile Count.c -w 12 -g 4

As specified here, DumpFile groups the output 4 bytes at a time on lines 12 bytes wide, as shown below.

File : Count.c
Data Fork Length     : 3723
Resource Fork Length : 478

Dumping Data Fork from offset 0 to 3722

   0: 2F2A2D2D 2D2D2D2D 2D2D2D2D /*----------
   C: 2D2D2D2D 2D2D2D2D 2D2D2D2D ------------
  18: 2D2D2D2D 2D2D2D2D 2D2D2D2D ------------
  24: 2D2D2D2D 2D2D2D2D 2D2D2D2D ------------
  30: 2D2D2D2D 2D2D2D2D 2D2D2D2D ------------
  3C: 2D2D2D2D 2D2D2D2D 2D2D2D2D ------------
  48: 2D2D2D2D 2D2D2D2D 0D0D4E41 --------..NA
  54: 4D450D20 20202020 20436F75 ME.......Cou
  60: 6E74202D 2D20636F 756E7420 nt.--.count.

The following command line displays the file's resource fork. According to the options specified, DumpFile writes the contents of bytes 0 through 30 of the resource fork to standard output in 4-byte groups.

DumpFile Count.c -rf -r 0,30 -g 4

File : count.c
Data Fork Length     : 3727
Resource Fork Length : 470

Dumping Resource Fork from offset 0 to 30

   0: 00000100 00000184 00000084 00000052 .......Ñ...Ñ...R
  10: 6865666C 20526565 73756420 68696C   hefl.Reestd.hil

SEE ALSO

DumpCODE

DumpObj

DumpPEF

DumpSYM

DumpXCOFF

 
 


Last Updated June 2001