home *** CD-ROM | disk | FTP | other *** search
- RX - a reverse Windows(tm)3.0 resource-compiler
- (resource extractor)
- (c) Copyright Andreas Gruen 1991
-
- September 30, 1991
- -------------------------------------------------------------------------
- NOTE:
- This is a completly experimental program in it's pre-beta version.
- It is not guaranteed to work properly under all circumstances, although
- it has been tested for a couple of weeks. Everyone who uses this program
- does this on his own risk, so if your machine explodes, don't tell me
- you didn't know.
-
- Andreas Gruen releases this software "as is", with no express or
- implied warranty, including, but not limited to, the implied warranties
- of merchantability and fitness for a particular purpose.
-
- This program is completly free for everyone.
- You can do with it and its sources whatever you want, but it would
- be fine to leave my name somewhere in the program or startup-banner.
- -------------------------------------------------------------------------
-
- It's assumed that the reader is somewhat familiar with Windows(tm)-
- Resources, i.e. Icons, Bitmaps, Dialogboxes, Menus etc.
-
- What's RX
- =========
-
- RX is the complement to the Rescource-complier RC shipped with
- the SDK. It extracts resources from an compiled files into a
- form that is readable and re-processable by RC. This means
- that you may easily change menus, dialog-boxes or the icon(s) of
- a progam and recompile it, without having the source-code, although
- this is not the intended purpose. If you do it, please note the
- copyright terms of the program you process.
-
- You may better use RX to extract for example icons from an
- icon-library to have them in a form you can import into other
- programs or work on them with an icon-editor.
- Or you want to create fonts, but not from the scratch.
- Or you want to see the authors of a programm (often included in
- STRINGTABLEs) or,or,or.
-
- Please note: RX is like RC not a Windows(tm)-Program but runs under
- DOS (or in the DOS-Box). If enough people find RX useful,
- I may think about a Win-Version.
- For recompiling you will need a resource-compiler
- compatible with Microsoft(R)'s RC.
-
- For insiders: RX supports all resources, except User-Defined resources,
- with all possible extentions (mem-options,load-options...).
- There are restrictions for STRINGTABLEs (see below)
- and icons and cursors that contain multiple images
- (see below).
- Because of this a recompiled file may differ from the
- original file although no changes were made. This may
- probably lead to difficulties in running the new program.
- (I haven't seen any).
-
-
- How to use RX
- =============
-
- Run RX with the following command-line:
-
- RX -options inputfile [outputname]
-
- options : are the view/extract options listed below.
-
- inputfile : contains the name of the file to be processed.
- You may specify an extension like .EXE,.DLL,.DRV,.FON,
- the default extension is .EXE
- It may contain a full pathname.
- The file must be a valid Windows(tm)3.0 file (Library or
- executable) otherwise RX will fail.
- outputname: (optional)
- secifies the (base-)name of the files that will be extracted.
- It should not contain an extension or a full path, although
- it will work (extensions are stripped, the path will only
- work for the .RC file).
- If an extract option is specified, RX will at least create
- a file 'outputname.RC', otherwise (only view option)
- the name is ignored.
-
- options: valid opitons are: i b c m d s f a r n x v
- (*nix-geetings) and may be combined (i.e. -i -v and -iv are
- equivalent).
-
- -i : extract all ICONs contained in the inputfile
- a 'name ICON ICONxxx.ICO' or 'number ICON ICONxxx.ICO'
- is appended to the RC-file, where xxx is a decimal integer.
- The name-statement will be used in the case the ICON has
- an assigned name stored in the inputfile. Otherwise the
- ordinal number will be used.
- The extracted icons are stored in separate files named
- ICONxxx.ICO.
- xxx is a decimal number that counts the extracted icons.
- NOTE: Icons that contain multiple (n) images are extracted
- to n .ICO-files. This usually leads to a larger recompiled
- executable and may lead to difficulties in running the new
- program.
- The format of the ICON-Files is the standard-icon format
- to use with any icon-editor.
-
- -b : extract all BITMAPs contained in the inputfile
- a 'name BITMAP BITMxxx.BMP' or 'number BITMAP BITMxxx.BMP'
- is appended to the RC-file, where xxx is a decimal integer.
- The name-statement will be used in the case the BITMAP has
- an assigned name stored in the inputfile. Otherwise the
- ordinal number will be used.
- The extracted BITMAPs are stored in separate files named
- BITMxxx.BMP.
- xxx is a decimal number that counts the extracted BITMAPs.
- The format of the BITMAP-Files is the standard-BITMAP
- (BMP) format.
-
- -c : extract all CURSORs contained in the inputfile
- a 'name CURSOR CURSxxx.ICO' or 'number CURSOR CURSxxx.CUR'
- is appended to the RC-file, where xxx is a decimal integer.
- The name-statement will be used in the case the CURSOR has
- an assigned name stored in the inputfile. Otherwise the
- ordinal number will be used.
- The extracted CURSORs are stored in separate files named
- CURSxxx.CUR.
- xxx is a decimal number that counts the extracted CURSORs.
- NOTE: CURSORs that contain multiple (n) images are extracted
- to n .CUR-files. This usually leads to a larger recompiled
- executable and may lead to difficulties in running the new
- program.
- The format of the CURSOR-Files is the standard-CURSOR format.
-
- -m : extract all MENUs contained in the inputfile.
- All MENUs are stored in a file named outputname.MEN
- and a '#include "outputname.MEN"' statement is appended
- to the RC-file.
- Within the .MEN-file a name-statement will be used in the
- case the MENU has an assigned name stored in the inputfile.
- Otherwise the ordinal number will be used.
-
-
- -d : extract all DIALOGs contained in the inputfile.
- All DIALOGs are stored in a file named outputname.DLG
- and a '#include "outputname.DLG"' statement is appended
- to the RC-file.
- Within the .DLG-file a name-statement will be used in the
- case the DIALOG has an assigned name stored in the inputfile.
- Otherwise the ordinal number will be used.
-
-
- -s : extract all STRINGTABLEs contained in the inputfile.
- All STRINGTABLEs are stored in a file named outputname.STR
- and a '#include "outputname.STR"' statement is appended
- to the RC-file.
- For insiders:
- Although it is not documented the Resorce-Compiler allows
- named and numbered STRINGTABLEs. This is currently not
- supported by RX. The string-numbers are computed using
- the method described in [2].
-
- -f : extract all FONTs contained in the inputfile,
- 'number FONT FONTxxx.FNT' (FONTS must not have names)
- is appended to the RC-file, where xxx is a decimal integer
- and number is the ordinal number of the font.
- The extracted FONTs are stored in separate files named
- FONTxxx.FNT.
- xxx is a decimal number that counts the extracted FONTs.
- The format of the FONT-Files is the standard-FONT (FNT)
- format.
-
- -a : extract all ACCELERATORs contained in the inputfile.
- All ACCELERATORs are stored in a file named outputname.ACC
- and a '#include "outputname.ACC"' statement is appended
- to the RC-file.
- Within the .ACC-file a name-statement will be used in the
- case the ACCELERATOR has an assigned name stored in the inputfile.
- Otherwise the ordinal number will be used.
- ACCELERATORS are fully supported.
-
- -r : extract all RCDATAs contained in the inputfile.
- All RCDATAs are stored in a file named outputname.RCD
- and a '#include "outputname.RCD"' statement is appended
- to the RC-file.
- Within the .RCD-file a name-statement will be used in the
- case the RCDATA has an assigned name stored in the inputfile.
- Otherwise the ordinal number will be used.
- NOTE: Because I found no bytes that describe the real length
- of the RCDATA I had to use the segment size.
- This leads usually to RCDATA statement filled up
- with trailing zeroes. It doesn't look nice, but
- it doesn't affect the recompiled file.
- Whenever the RCDATA is printable, strings will be
- used to compact the RCDATA-file.
-
- -n : extract the nametable contained in the inputfile.
- This is not necessary to recompile, but may be
- useful. In the nametable-file every resource that
- has a name is listed with its ordinal number.
- The nametable (not the file) is internally used
- to create name-statements. The nametable is
- not documented (as far as I know).
- Nothing is appended to the .RC-file.
-
-
- -x : extract everything contained in the inputfile.
- same as -ibcmdsfarn
-
- -v : verbose mode: additionally informations about
- every resource are printed. Only useful for
- those who are familiar with the extended executable
- file-format.
- -?, -h : help : prints short usage-description
- also printed when RX is run without arguments.
-
-
- Try it to learn more.
-
- Thanks to Brigitte for letting me sit behind the screen instead of doing
- housework for these days and for the beer and pizza.
-
-
-
- Lit & Refs:
- ==========
-
- [1] Microsoft Windows Software Development Kit (SDK)
- Reference - Volume 1
- [2] Microsoft Windows Software Development Kit (SDK)
- Reference - Volume 2
- especially: Section: The Resource-Compiler