home *** CD-ROM | disk | FTP | other *** search
/ Windoware / WINDOWARE_1_6.iso / source / dmpprg12 / dumpprog.doc next >
Text File  |  1991-08-15  |  5KB  |  129 lines

  1. DUMPPROG version 1.2 - Dump .EXE file in mixed disassembly and source code.
  2.  
  3.   Copyright (c) D.J. Murdoch, 1991
  4.   Portions of disassembler copyright (c) L. David Baldwin, 1986
  5.  
  6. Syntax: DUMPPROG [option] progname
  7.  
  8.   reads map from progname.MAP and dumps executable progname.EXE.
  9.  
  10.   /Exxx  Use source extension xxx if unspecified in MAP file.
  11.   /O     Dump old-style stub of Windows or OS/2 executable
  12.   /Snnnn Dump segment nnnn (hex value or name) completely.
  13.  
  14. Examples:
  15.  
  16.   DUMPPROG myprog.exe
  17.     will use myprog.map for information, and make no assumptions about
  18.     extension.  Output will go to the screen.
  19.   DUMPPROG myprog /Epas >myprog.lst
  20.     will dump myprog.exe using myprog.map for information, and assume
  21.     that any source file with no extension should have .pas added,
  22.     putting the results into the file myprog.lst.
  23.   DUMPPROG myprog /S0000
  24.     will dump the very first segment of myprog.exe, whether or not
  25.     there's any line number information.
  26.   DUMPPROG myprog /Smyprog
  27.     will dump the segment named "myprog" from the program myprog.exe.
  28.  
  29. Description:
  30.  
  31.   This is a rough program designed to let you see disassembled output
  32.   mixed with source code, as some compilers will optionally output.  It
  33.   requires a detailed .MAP file from the compiler which includes source
  34.   files and line number information.  If you don't have one, it will try
  35.   to construct a segment map; you must then explicitly ask for a
  36.   particular segment (using the /S option) to see the disassembled
  37.   output.
  38.  
  39.   I wrote it and tested it on the .EXE files and .MAP files produced by
  40.   Turbo Pascal 6.0; it should work (but probably has bugs) on other
  41.   programs.  To get a detailed map from Turbo Pascal, use the $D+
  42.   (debugging info) and /GD options on the command line, or set these
  43.   options in the IDE.
  44.  
  45.   You can control which parts of a program are dumped by editing the
  46.   .MAP file, or using the /S option.  With no /S, those parts of
  47.   the file for which there's line number information will be dumped.
  48.   If the /Snnnn option is used, the segment specified will be completely
  49.   dumped, whether or not line number information is available.
  50.  
  51. Limitations:
  52.  
  53.   This version of DUMPPROG completely ignores all of the public symbol
  54.   names in the .MAP file.  It displays hex addresses where a smarter
  55.   disassembler would put names.
  56.  
  57.   DUMPPROG can't tell code from data with standard .EXE files.  In Turbo
  58.   Pascal executables, constant data is kept at the beginning of code
  59.   segments.  DUMPPROG will often try to disassemble this, producing
  60.   lengthy streams of nonsense.
  61.  
  62.   It doesn't know whether a source line is complete or not.  The map
  63.   file says where the source starts; it doesn't say where it ends.
  64.   DUMPPROG only inserts a single line of source for each reference in
  65.   the MAP file.
  66.  
  67.   It also doesn't know where code ends, but does a bit better here.
  68.   Generally it assumes code stretches to the next line given in the MAP
  69.   file.  This can lead to very long stretches of assembler with no
  70.   source, and probably with incorrect segment/offset addresses, if
  71.   there's a gap in the .MAP. For the last line in the .MAP file, it
  72.   displays up to the the start of the next segment, or the end of the
  73.   executable, whichever comes first.
  74.  
  75.   On Windows or OS/2 executables, DUMPPROG doesn't do anything to
  76.   interpret loader fixups.  This means most far calls won't have useful
  77.   addresses.
  78.  
  79.   Source code must be in the current directory, or on a path specified
  80.   with the filename in the .MAP file.  If DUMPPROG can't find the
  81.   source, it will print a warning and go ahead, leaving blanks where the
  82.   source code should go.
  83.  
  84.   The disassembler in DUMPPROG is an adaptation of a module from L.
  85.   David Baldwin's excellent UNINLINE program (used with permission).
  86.   It's taken from a 1986 version of the program; the original code could
  87.   only disassemble 8086 opcodes.  I've horribly mutilated the module to
  88.   fit DUMPPROG and add 80286 and 80386 opcodes, but there are some
  89.   missing, and I may even have introduced bugs into the 8086
  90.   disassembly.
  91.  
  92. History
  93.  
  94.   1.0 - First version
  95.  
  96.   1.1 - Added code for Windows/3 executables as well as standard DOS
  97.         .EXE files; it may also handle OS/2 executables, but I don't
  98.         have any to try it on.
  99.  
  100.   1.2 - Added some 286 and 386 opcodes to disassembler
  101.  
  102. License
  103.  
  104.   DUMPPROG is not a public domain program.  It contains code whose
  105.   copyright belongs to L. David Baldwin and D.J. Murdoch, as well as
  106.   library code from Borland International and TurboPower Software.
  107.  
  108.   You are free to use DUMPPROG without charge.  You may distribute it
  109.   unmodified, together with this documentation file, provided that you
  110.   charge no more than distribution costs, and on no account more than
  111.   $10 per copy.
  112.  
  113. Warranty
  114.  
  115.   There is no warranty of any kind with this program.  It is
  116.   experimental software, and likely contains bugs.  Use at your own
  117.   risk.
  118.  
  119. Note:  Version 1.2 is the first public release of DUMPPROG.  Expect
  120. bugs.  If you find any, please send bug reports to me (Duncan Murdoch)
  121. at one of the following addresses:
  122.  
  123.  DJ Murdoch at Fidonet node 1:221/177.40
  124.  dmurdoch@watstat.waterloo.edu  on Internet
  125.  71631,122 on Compuserve
  126.  
  127.  79 John St. W
  128.  Waterloo, Ontario, Canada
  129.  N2L 1B7