NAME
DeRez - decompiles resources
SSYYNNTTAAXX DDeeRReezz resourceFile [ typeDeclFile1 [ typeDeclFile2 ] ... ][ -cc[oommppaattiibbllee] ] [ -dd[eeffiinnee] macro [ = data ] ]
[ -ee[ssccaappee] ] [ -ii directoryPath ] [ -iiss[yyssrroooott] sdkPath ]
[ -mm[aaxxssttrriinnggssiizzee] n ] [ -nnooRReessoollvvee ]
[ -oonnllyy typeExpr [ ((idExpr1 [::idExpr2 ] | resourceName)) ] ]
[ -oonnllyy type ] [ -pp ] [ -rrdd ]
[ -ssccrriipptt RRoommaann | JJaappaanneessee | KKoorreeaann | SSiimmppCChhiinneessee |
TTrraaddCChhiinneessee ][ -ss[kkiipp] typeExpr [ ((idExpr1 [::idExpr2 ] | resourceName)) ] ]
[ -ss[kkiipp] type ] [ -uu[nnddeeff] macro ]
[ -uusseeDDFF ]
DESCRIPTION
The DDeeRReezz tool decompiles the resource fork of resourceFile according to the type declarations supplied by the type declaration files. The resource description produced by this decompilation contains the resource definitions (resource and data statements) associated with these type declarations. If for some reason it cannot reproduce the appropriate resource statements, DDeeRReezz generates hexadecimal data statements instead. A type declaration file is a file of type declarations used by the resource compiler, RReezz.. The type declarations for the standard Macintosh resources are contained in the CCaarrbboonn..rr resource header file,contained in the Carbon framework. You may use the ${RIncludes} shell
environment variable to define a default path to resource header files. If you do not specify any type declaration files, DDeeRReezz produces data statements in hexadecimal form. This same process works backward to recompile the resource fork. If you use the output of DDeeRReezz and the appropriate type declaration files as input to RReezz,, it produces the original resource fork of resourceFile. IINNPPUUTT An input file containing resources in its resource fork. DDeeRReezz does not read standard input. You can also specify resource description files containing type declarations. For each type declaration file onthe command line, DeRez applies the following search rules: 1. DDeeRReezz
tries to open the file with the name specified as is. 2. If rule 1 fails and the filename contains no colons or begins with a colon, DDeeRReezz appends the filename to each of the pathnames specified by the {RIncludes} environment variable and tries to open the file. OOUUTTPPUUTT Standard output. DDeeRReezz writes a resource description to standard output consisting of resource and data statements that can be understood by RReezz.. If you omit the typeDeclFile1 [ typeDeclFile2 ]... parameter, DDeeRReezz generates hexadecimal data statements instead. Errors and warnings are written to diagnostic output. AALLIIAASS RREESSOOLLUUTTIIOONN This command resolves Finder aliases on all input file specifications. Finder aliases are also resolved in the pathnames of any files included by specified resource definition files. You can optionally suppress the resolution of leaf aliases for the input resource file (with the-nnooRReessoollvvee option).
SSTTAATTUUSSDeRez can return the following status codes:
00 no errors 11 error in parameters 22 syntax error in resourceFile 33 I/O or program error PPAARRAAMMEETTEERRSS resourceFile Specifies a file containing the resource fork to be decompiled. typeDeclFile1 [ typeDeclFile2 ]... Specifies one or more files containing type declarations. These type declarations are the templates associated with the information in the resource description. In addition to usingthose in the $${{RRIInncclluuddeess}} folder, you can also specify your own
type declaration files. NNootteeThe DDeeRReezz tool ignores any iinncclluuddee (but not ##iinncclluuddee), rreeaadd,
ddaattaa, cchhaannggee, ddeelleettee, and rreessoouurrccee statements found in these files. However, it still checks these statements for correct syntax. OOPPTTIIOONNSS-cc[oommppaattiibbllee]
Generates output that is backward-compatible with RReezz 1.0.
-dd[eeffiinnee] macro [ == data ]
Defines the macro variable macro as having the value data. You can use this option more than once on a command line. macro Specifies the macro variable to be defined. data Specifies the value of macro. This is the same as writing#define macro [ data ]
at the beginning of the resource file. If you do not specify data, DDeeRReezz sets the value of data to the null string. Note that this still defines the macro.-ee[ssccaappee]
Prints characters that are normally escaped, such as \0xff, as extended Macintosh characters. By default, characters withvalues between $20 and $FF are printed as Macintosh characters.
With this option, however, DDeeRReezz prints all characters (except null, newline, tab, backspace, form feed, vertical tab, and rubout) as characters, not as escape sequences. NNoottee Not all fonts have all the characters defined.-ii directoryPath
Specifies the directory to search for ##iinncclluuddee files. You may
specify this option more than once. Directory paths are searched in the order in which they appear on the command line.-iiss[ysroot] sdkPath
Specifies the system SDK in which to search for include files and frameworks. If omitted, the system root ("/") is assumed.-mm[aaxxssttrriinnggssiizzee] n
Sets the maximum output string width to n, where n must be inthe range 2-120.
-nnooRReessoollvvee
Suppresses leaf alias resolution of the file or pathname for the input resource file thus allowing the resource fork of a Finder alias file to be decompiled. Finder aliases are still resolved on all resource definition file paths and on any files they may include.-oonnllyy typeExpr [ ((idExpr1[::idExpr2] | resourceName)) ]
Reads only resources of the type indicated by typeExpr. An ID (idExpr1), range of IDs (idExpr1:idExpr2), or resource name can also be supplied to further specify which resources to read. If you provide this additional information, DDeeRReezz reads only the specified resources. This option can be repeated multiple times. Note that thisoption cannot be specified in conjunction with the -sskkiipp option.
NNoottee The typeExpr parameter is an expression and must be enclosed in single quotation marks. If you also specify an ID, range of IDs, or resource name, you must place double quotation marks around the entire option parameter, as in these examples:-only "'MENU' (1:128)"
-only "'MENU' ("'"Edit"'")"
-oonnllyy type
Reads only resources of the specified type. It is not necessary to place quotation marks around the type as long as it starts with a letter and contains no spaces or special characters. For example, this specification doesn't require quotation marks:-only MENU
Escape characters are not allowed. This option can be repeated multiple times.-pp Writes progress and summary information to standard output.
-rrdd Suppresses warning messages emitted when a resource type is
redeclared.-ssccrriipptt RRoommaann | JJaappaanneessee | KKoorreeaann | SSiimmppCChhiinneessee | TTrraaddCChhiinneessee
Enables the recognition of any of several 2-byte character
script systems to use when compiling and decompiling files. Thisoption insures that 2-byte characters in strings are handled as
indivisible entities. The default language is RRoommaann andspecifies 1-byte character sets.
-ss[kkiipp] typeExpr [ ((idExpr1 [::idExpr2 ] | resourceName)) ]
Skips resources of the type indicated by typeExpr. For example, it is very useful to be able to skip 'CODE' resources. An ID (idExpr1), range of IDs (idExpr1:idExpr2), or resource name can also be supplied to further specify which resources to skip. If you provide this additional information, DDeeRReezz skips only the specified resources. You can repeat this option multiple times. Note that this optioncannot be used in conjunction with the -oonnllyy option.
NNoottee The typeExpr parameter is an expression and must be enclosed in single quotation marks. If you also specify an ID, range of IDs, or resource name, you must place double quotation marks around the entire option parameter, as in this example:-skip "'MENU' (1:128)"
-skip -only "'MENU' ("'"Edit"'")"
-ss[kkiipp] type
Skips only resources of the specified type. It is not necessary to place quotation marks around the type as long as it starts with a letter and does not contain spaces or special characters. For example, this specification doesn't require quotation marks:-skip CODE
Escape characters are not allowed. This option can be repeated multiple times.-uu[nnddeeff] macro
Undefines the preset macro variable This is the same as writing#undef macro
at the beginning of the resource file. This option can be repeated more than once on a command line.-uusseeDDFF Reads and writes resource information from the files' data
forks, instead of their resource forks. EEXXAAMMPPLLEESS The following command line displays the 'cfrg' resources in the CarbonLib library. The type declaration for 'cfrg' resources is found in the CCaarrbboonnCCoorree..rr framework umbrella resource header file./Developer/Tools/DeRez -I
/System/Library/Frameworks/CoreServices.framework/Frameworks/ CarbonCore.framework/Headers/ /System/Library/CFMSupport/CarbonLib CarbonCore.r In the following example, DDeeRReezz decompiles the 'itl1' resource ID 0 inthe data-fork-based localized resource file in the HIToolbox framework.
$ export RIncludes=/System/Library/Frameworks/Carbon.framework/Headers/
$ /Developer/Tools/DeRez -only 'itl1'
/System/Library/Frameworks/Carbon.framework/Frameworks/ HIToolbox.framework/Resources/English.lproj/Localized.rsrc Carbon.r-useDF
SEE ALSO
RReezzMac OS X July 24, 2000 DeRez(1)