                                                                    14-Aug-95



                        EXECHAIN - Version 3.0
                        ----------------------


                           ****************
                           * USER'S GUIDE *
                           ****************



   --------------------------------------------------------------------


     This program is SHAREWARE:  $20.00 + $4.00 S/H

     You can register on CompuServe:  GO SWREG and select #4843

     Or, you may send a check or money order in
     US funds, made payable to Frank E. Haggar at:

       Frank E. Haggar
       21118 Madria Circle
       Boca Raton, Fla 33433


     FOR TECH SUPPORT, please contact:

     CompuServe: Frank Haggar (75672,1206)
     INTERNET:   75672.1206@compuserve.com


   --------------------------------------------------------------------


 I. Overview:
 ============

     This program reads in New Executable (NE) files and processes the
   relocation records (fixups) looking for duplicates or chains.  The
   program can list a summary of this information on a segment-by-segment
   basis.  It will also produce overall totals for all relocation records,
   chained records, and duplicate records.

     This utility is based on the information about relocation record
   chaining which appeared in the July 1993 issue of Microsoft Systems
   Journal.  The title of the article is:  "Liposuction Your Corpulent
   Executables and Remove Excess Fat", by Matt Pietrek (Volume 7, 1993)

     In his discussion of reducing the size of executables, Matt describes
   the Windows' loader support for chaining relocation record together by
   utilizing the target address for the head record as a link to another
   offset requiring the identical fixup value.  The chain is terminated by
   the occurance of 0xFFFF in the segment data at the fixup's target offset.

     EXECHAIN was written based on this concept, since not all linkers
   utilize this feature of the NE file format when creating executables.  It
   can produce detailed lists on both the "before" and "after" files, and
   reports the overall savings in file size.

     Simply provide the name of an NE file on the command line or use the
   "Open" menu command to load any NE formatted executable file.  The
   program will report an error if other types of files are loaded.  Another
   easy way to select a file is by using the new "Directory List" command,
   which scans a directory and only lists NE files.  This list also shows
   the savings per file that EXECHAIN can provide!



 II. THE DISPLAY:
 ================

     When you load an executable, the main window will contain a brief
   summary of the relocation record information and an estimate of how much,
   (if any) space EXECHAIN can recover.  The displayed values include counts
   of duplicate relocation fixup records in the file, relocations that can
   be reworked into chains by slight modification to the relocation records,
   and the number of existing fixups that are already chained to relocation
   records.

     An estimate on how much space can be saved by using this program is
   also calculated and displayed.  Note that this estimate is based on
   accurate relocation counts and file size values The final file size won't
   match exactly because the segment/resource sector alignment factor can
   distort the results due to byte padding.

     The calculations will report the correct number of bytes containing
   duplicate information, but it's possible to condense these without
   shrinking the actual filedue to overly large segment alignment sizes.
   Use Matt Pietrek's EXESIZE utility (from July 1993's issue of MSJ and
   available on MSL) to determine the optimal alignment factor.  If yours is
   not optimal, relink with the suggested value, then try EXECHAIN again.

     Once EXECHAIN has been run, the estimate will be replaced by an actual
   calculation based on the change in the disk file size.  This will provide
   accurate information on the number of bytes removed from the executable.




 III. MENU COMMANDS:
 ===================

  ----
  File
  ----

    Open
    ----
       Presents the standard COMMDLG dialog box.  There are lots of various
     file extentions used for NE executables under Windows, and many of them
     are available in the "List of File Types" dropdown.


     Save
     ----
       This will prompt for confirmation, allowing you to specify options
      to retain the original file date/time and/or to strip any debugging
      information for you automatically.  There is also an option that lets
      you create a backup of the original file.  Selecting that option
      will grow the dialog box larger, allowing you to override the name of
      the backup file and it's drive/directory location.

       The Save command will overwrite your original executable file, and
      DOES NOT require any additional disk space unless you create a backup
      file.  This means that if EXECHAIN is interrupted (power flicker, etc)
      and you have not requested the creation of a backup, the original file
      is probably suspect and should be deleted to avoid the danger and risk
      of attempting to re-chain (or attempt to run) a corrupt program file.


     Save As
     -------
       This will prompt for a filename using a special "Save As" dialog box,
      which includes options to retain the original file date/time and to
      strip any debugging information for you automatically.


      ** NOTES ON USING "SAVE" OR "SAVE AS" **
         ----------------------------------

      EXECHAIN prompts before overwriting existing files.  EXECHAIN always
     tests any file you attempt to overwrite.  The popup prompt dialog will
     inform you if the existing file is an NE executable or not.

       EXECHAIN will also prompt if it detects the file you're overwriting
     is currently loaded into memory as a running executable. It will warn
     you of the potential danger of overwriting the program, preventing you
     from doing so!

       After the file has been successfully saved, the saved output will auto-
     matically be re-opened so you can see the size reduction results.  You
     will see a comparison of the old file size against the new file size,
     with the size percentages calculated as well.

     Exit
     ----
       Closes EXECHAIN (and also closes the directory list window, if open).

   ----
   View
   ----

    Relocation Totals
    -----------------
       Selecting this menu item will produce a report of relocations per
     segment, A dialog box will contain a report of the number of chained and
     duplicated relocations on a segment-by-segment basis.  There are columns
     for each type of relocation, including additive relocations, which are
     not chained, but might be able to be "reworked" into another type of
     relocation, then chained with other reworked relocation records.

    Directory List
    ---------------
       Scans the directory you select from a dialog box and presents a list of
     all of the Windows 3.x 16 bit (NE formatted) executable files.  Each
     file is shown with an estimate of the amount of space that can be saved
     for that file.  The total of these estimates is presented at the bottom
     of the list.  You can use the mouse to dblclk on any of these files, and
     it will be opened.

       Note that chaining the relocations does not automatically update this
     list.

       Also note that you can select a new directory by using the File/Open
     command and changing to the directory you are interested in.  Then,
     either select a file, or press CANCEL.  Either way, EXECHAIN will use
     that as the current directory if the Directory List command is rerun.



 IV. CREDITS:
 ============

     I'd like to take time to thank Matt Pietrek for his help finding a bug
   related to ITERATED data segments and testing my fixes until I got it
   right.   I'd also like to thank Bob Swart for his help finding and fixing
   a bug related to EXE or DLL files that did not contain resources.

   EXECHAIN wouldn't be as reliable without their efforts!!  THANKS, GUYS!

==========================================================================


  LEGAL DISCLAIMER:
  -----------------

     THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED
   TO AS "SOFTWARE") IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER
   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

    IN NO EVENT SHALL FRANK E. HAGGAR, MICROSOFT, BORLAND INTL., OR
   ANYONE ELSE BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT,
   INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR
   SPECIAL DAMAGES, EVEN IF FRANK HAGGAR OR ANY OTHER PARTY CREDITED
   WITHIN THIS SOFTWARE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
   DAMAGES.

     USE AT YOUR OWN RISK!!   PLEASE BE CAREFUL.

   RUNNING THIS PROGRAM ACKNOWLEDGES YOUR ACCEPTANCE OF THIS AGREEMENT.

============================================================================


    ORDERING INFORMATION:
    ---------------------

     Please register your copy to recieve technical support and to be legal.

       The cost to register is $20.00   See ORDER.TXT for complete ordering
     information on how to get an official registered copy of the software,
     and for information on SHIPPING/HANDLING charges.


     Thank you all for your support, and please don't forget to register!


     Frank E. Haggar
     21118 Madria Circle
     Boca Raton, Fla. 33433

     CompuServe: 75672,1206
     INTERNET: 75672.1206@compuserve.com


============================================================================

   THANK YOU FOR REGISTERING EXECHAIN!

   Frank E.  Haggar

_____________________________________________________________________________
        Copyright 1994,1995 by Frank E. Haggar    (ALL RIGHTS RESERVED)
