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

MPW Command Reference




DumpPEF pefFile… [-a[nnotate] {-v[erbose]}] [-c[heck]] [-cache on | off]
[-cont[ainer] number] [-dialect cpu[,vec[tor]]] [-do all | optLetters]
[-format {-fmt} fmtParams] [-forks whichForks] [-h] [-ibm]
[-loader {-ldr} all | ldrLetters] [-mark] [-maxlines n] [-ntb]
[-o[ffsets]] [-p] [-pi[data] piLetters] [-sect[ion] s] [-stripped]
[-summarize] [-tb] [-u[nmangle]] [-w] [-w601]


The DumpPEF tool validates and displays the contents of PEF files, with each section appropriately formatted and each field annotated according to section type.

DumpPEF can display the contents of a PEF container stored in either the data fork or a resource. DumpPEF can read containers created with ILink, PPCLink, MakeFlat, or MakePEF.

DumpPEF searches the input file for a 'cfrg' resource indicating the location of the containers. If no 'cfrg' resource exists, DumpPEF assumes that the container occupies the entire data fork. If no 'cfrg' resource exists and the data fork is empty, DumpPEF displays an error message and quits.

Any or all sections can be selectively displayed. The validations check all fields that can be reasonably checked. Errors and warnings are reported as part of the standard output. If you specify the -check option, only the validations are performed, without generating any output (errors or warnings resulting from incorrect fields are reported).

DumpPEF reports a warning if a PowerPC code section does not begin on a longword boundary within the container or the file. It also reports a warning if a 68K code section does not begin on a word boundary within the container or the file. A warning is also reported if a "use in place" section is not properly aligned within the container.


PEF container files (pefFile). DumpPEF does not read standard input. If no input files are specified, DumpPEF displays help information.


DumpPEF writes the formatted file structures and disassembled code to standard output.


DumpPEF can return the following status codes:


no errors


error in parameters or options


execution error


validation errors reported


only POWER instruction warnings were reported (-w601 option specified)


user interrupt



Specifies one or more PEF files to display. DumpPEF can display multiple PEF containers stored within a single file.


The option descriptions are grouped into the following functional categories:

Processing Control

Disassembly Control

Output Control

Miscellaneous Options

For options that have parameters, the bold parameters are the default values that apply if the option is not specified on the command line. For example, in the case of the -do option, the behavior defined by the h and l parameters applies when the -do option is omitted. •

Processing Control

These are the main control options that determine what DumpPEF processes.


Checks (validates) only. All output to the standard output is suppressed. Only errors and warnings, if any, are reported to the diagnostic output.

-cont[ainer] number

Limits the processing to the specified container. Containers are numbered beginning at 1. This option overrides the -forks option.

-do all | optLetters

Processes the specified PEF sections. You specify either all or selected sections using one or more of the following options (optLetters):

c | t

Main header and section headers
'cfrg' and 'rseg' resources
Section header and string table
All raw data sections (except code and data)
Code (text) section
Data section
Pidata section
Constant section
Exec data section
Loader section (headers, relocations, symbols)
Debug section
Exception section
Traceback section

-loader {-ldr} all | ldrLetters

Provides more precise control over loader section processing than the -do l option. You specify either all or selected loader sections using one or more of the following options (ldrLetters):


Loader header
Loader import IDs
Loader import symbol table
Loader relocation header and instructions
Loader string table
Loader hash slot table
Loader export chain table
Loader export symbol table
Loader export symbol names
All except export slot and chain tables

The -do l option is implied by using the -loader option. •

-pi[data] piLetters

Provides more precise control over pidata section processing than the -do p option. You specify one or more of the following options (piLetters):


Display the unpacked data produced by the pidata
Vertical pidata display (each repeat on a new line)
Show only the pidata instructions and no encodings

The -do p option is implied by using the -pidata option. •

-forks whichForks

Processes only the containers in the specified forks. You specify one of the following options (whichForks):

resource {rsrc}

Process only containers in the resource fork


Process only containers in the data fork

both {all}

Process all containers in both forks

-sect[ion] s

Limits section relative processing to section s, where s is the section number (starting at 0).

Disassembly Control

These options control how the disassembly of the code sections is processed.

-dialect cpu[,vec[tor]]

Sets the disassembly dialect to cpu, where cpu is one of the following:

Power {Pwr}

RS/6000 POWER architecture

PowerPC601 {PPC601}

PowerPC 601 architecture

PowerPC32 {PPC32}

32-bit PowerPC architecture

PowerPC64 {PPC64}

64-bit PowerPC architecture


vector extensions

Except for vector, only one cpu can be specified. Vector may be combined with any of the others (except Power) separated by a comma or used alone when specifying the default dialect. When vector is specified, AltiVec instructions will be disassembled instead of being treated as illegal instructions. A 'V' flag will appear in the flags column to indicate AltiVec instructions.

This option is applicable only to PowerPC code disassembly. •

-format {-fmt} fmtParams

Specifies code section formatting. The fmtParams parameter uses the following syntax:

on[=fmtOptions] | off[=fmtOptions] |
fmtOptions,on | fmtOptions,off

Specifying -format on (or off) in conjunction with any of the fmtOptions parameters listed below disassembles the code section using the specified formatting.

Specifying -format on with no fmtOptions parameters disassembles the code section using the default formatting options (the bold options in the list below). Specifying -format off with no fmtOptions parameters displays the code section in unformatted hexadecimal, which is the default.

You specify the fmtOptions parameter using one or more of the following characters:


Show d(RA) displacements in decimal instead of hexadecimal


Show fields (for example, shift/rotate constants) in decimal instead
of hexadecimal

h {$}

Show hexadecimal values with a leading $ instead of 0x

i {s}

Show signed immediates in decimal instead of hexadecimal


Show hexadecimal with the smallest even number of digits


Show PC-relative values in decimal instead of hexadecimal


Show unsigned immediates in decimal instead of hexadecimal


Show extended mnemonics (except when -dialect is set to Power)


Show negative hexadecimal values in two's complement instead
of negated hexadecimal


Formats the disassembly using IBM Assembler conventions for comments and directives. The default is to use Apple PowerPC Assembler conventions.


Specifies that there are no traceback tables in the code. Normally, an all zero instruction defines where a traceback table begins. If you know there are no traceback tables in the code, use this option to indicate that all data is to be interpreted as instructions and disassembled. Without this option, if DumpPEF encounters data that appears to be a traceback table, it interprets it as such. If the data is not a traceback table, the output may be confusing.


Displays traceback tables appropriately formatted and annotated. Normally the display of the traceback information is suppressed. Use the -ntb option if you know there are no tracebacks in the code.

Output Control

-a[nnotate] {-v[erbose]}

Annotates every PEF field with information appropriate to that field. This annotation, while more informative, causes much more output than the default format. The default format provides most of the same data but annotates it more briefly and displays it in a wider format. The -annotate format is narrower. The -verbose option is a synonym for -annotate, and produces identical output.


Generates MPW Shell markers on each title in the output. There is no restriction on the standard output file (that is, it can be an open window) other than the fact that markers are not generated to the output file if that output file is also the window from which you initiated the DumpPEF command.

Multiple PEF files can be specified on the command line, there is only one output file, and the titles are always the same for each file. Therefore, to make the markers unique, DumpPEF prefixes the marker names with a file index number. A dividing line is also generated between each file's markers. The index number is just the count of the number of input files processed. •

-maxlines n

Limits all section displays (except headers) to n lines. Only the first n lines of each section are displayed and processed.


Suppresses the display of the PEF file offsets. The default is to show the file offsets at the left edge of the output for every field displayed.


Suppresses titles, break lines, summary information, and offsets. This option is not recommended for multiple PEF container files.


Unmangles C++ names. DumpPEF attempts to unmangle symbols from the loader export symbol table, the loader import symbol table, and traceback tables. This option should only be used if the PEF file is from a C++ compiler.


Suppresses warnings. Only error messages, if any, are shown and counted (for the summary).


Generates explicit warning messages about the use of POWER instructions and PowerPC 601-specific SPRs when the -dialect PowerPC601 option is specified and the code section is disassembled. The default is to generate a flag in the disassembly, but these instructions are always counted to report in the summary that POWER instructions were used. Use this option to find where these instructions exist in the file and what they are, since the disassembled line is always shown with the warning.

Miscellaneous Options

-cache on | off

Enables (on) or disables (off) data caching.


Displays a brief summary of DumpPEF options. This option overrides all other options. The help information is also displayed if no PEF files are specified on the command line.


Writes the version and progress information to the diagnostic output file.


Displays a summary of the results of processing each file. The summary is sent to the diagnostic output and is always generated if any errors or warnings are reported.


The default options process the headers and imports, and the relocations and exports in the loader section. Code sections are not disassembled. The command below processes the file myLibrary according to the default options.

DumpPEF myLibrary > myLib.pef

This is identical to the following command:

DumpPEF myLibrary -do hl -loader hirx -forks both -cache on ∂
-format off > myLib.pef

In the example below, only the library's exports are displayed.

DumpPEF myLibrary -ldr x > myLib.pef

The following command displays the list of import libraries with which the client application (ClientApp) was linked, along with the list of imported symbols.

DumpPEF ClientApp -loader fi > ClientApp.pef

The command below processes the entire file (-do all) for validation purposes only (-check). If there are any errors or warnings, they are written to the diagnostic file. No standard output file is generated.

DumpPEF myLibrary -check -do all

The example below displays all of the 68K and PowerPC code sections in myLibrary in disassembled form instead of unformatted hexadecimal.

DumpPEF myLibrary -do c -format on

You can use the following command to list only the names of the exports in a single library file (singleLibrary). The resulting output can be sorted and used later for verifying that the library exports the desired routines.

DumpPEF singleLibrary -loader n -stripped

The -stripped option should be used only on single PEF container files. •








Last Updated December 2000

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice