home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / PROGRAM / STRIPPED.ZIP / STRIPPED.DOC next >
Text File  |  1992-05-30  |  4KB  |  88 lines

  1. STRIPPED - Check directories for files damaged by TDSTRIP.
  2.  
  3. Written by D.J. Murdoch for the public domain, May, 1992.
  4.  
  5. SYNTAX:
  6.  
  7.   STRIPPED dir
  8.  
  9. will search the given directory, and any of its subdirectories, for
  10. damaged .EXE files.
  11.  
  12. DESCRIPTION:
  13.  
  14. Borland ships a utility called TDSTRIP with its Turbo Debugger.  TDSTRIP
  15. lets you strip the external debugging information out of .EXE or .OBJ
  16. files.  However, version 2.0 (and some later ones) contain a serious
  17. bug:  it damages the header of the .EXE file, setting the "minimum extra
  18. allocation" field to zero.
  19.  
  20. The extra allocation fields are used by DOS to determine how much memory
  21. to give to your program.  In addition to the amount needed to load the
  22. image of your .EXE file, you'll get at least the minimum allocation and
  23. as much as the maximum allocation, if it's available.  If there's not
  24. enough memory to give you the minimum allocation, DOS will refuse to
  25. load the program.
  26.  
  27. The extra memory is used in different ways depending on the
  28. compiler/linker, but Turbo Pascal makes typical use of it: uninitialized
  29. static variables, the stack, the overlay buffer, and the heap all reside
  30. there.
  31.  
  32. If you try to load a TDSTRIP-damaged .EXE file, usually nothing bad will
  33. happen.  You'll have more than the required minimum, and things will be
  34. fine.  However, if memory is very tight, you might have less than the
  35. true minimum, but more than the 0 value that TDSTRIP has put in.  Your
  36. program may be loaded with an initial stack pointer in video memory, or
  37. in an area where there's no memory, or in the middle of a TSR that's
  38. been loaded above it.  You'll quickly crash.
  39.  
  40. The program STRIPPED is an attempt to detect these damaged files.  It
  41. checks the header, and verifies that the initial stack pointer is going
  42. to fall within the minimum allocation.  If not, it prints the name of
  43. the file, and the amount of free RAM which you'd need to have for it to
  44. actually matter.
  45.  
  46. STRIPPED doesn't try to fix the .EXE, because there's no way to know
  47. what the true minimum allocation should be; the program may use
  48. overlays, or depend on a certain size of heap. Turbo Pascal 6 source for
  49. STRIPPED is included in this archive, so feel free to attempt fixes if
  50. you feel confident.  A safer approach, if available, is to recompile the
  51. bad .EXE, and not to use TDSTRIP on it.  The EXEMOD program distributed
  52. with some compilers could also be used to repair the damage, if you're
  53. willing to guess at the required size.
  54.  
  55. MY DAMAGED PACKAGES:
  56.  
  57. Several programs that I've release to the public have damaged .EXEs in them.
  58. Here's the list I know about:
  59.  
  60.   Package                File                 Danger Zone
  61.  
  62.   CACHEMON           CACHEREP.EXE          16832 < RAM < 34128
  63.   GLUE                   GLUE.EXE          10560 < RAM < 29600
  64.   INTRFC5              INTRFC.EXE          28912 < RAM < 47616
  65.   INTRFC55             INTRFC.EXE          39728 < RAM < 58464
  66.   INTRFC62             INTRFC.EXE          49136 < RAM < 67888
  67.   NEXTCLUS           NEXTCLUS.EXE           3088 < RAM < 20080
  68.   SAVEMOUS           RESTOREM.EXE           4976 < RAM < 22240
  69.   SCAN200A           SCANHELP.EXE          40832 < RAM < 78768
  70.   TDHIDE               TDHIDE.EXE          18448 < RAM < 36208
  71.   TPU2TPS             TPU2TPS.EXE           4256 < RAM < 54256
  72.   VCPIMAP             VCPIMAP.EXE          15824 < RAM < 32864
  73.  
  74. The "danger zone" values above are off by a few hundred bytes; I
  75. produced this list with an older version of STRIPPED.
  76.  
  77. SUPPORT:
  78.  
  79. Support?  Well, comments on STRIPPED should be sent to me at one of the
  80. following addresses.  No guarantee that I'll be able to help though.
  81.  
  82.   Internet:    dmurdoch@watstat.waterloo.edu
  83.   Fidonet:     DJ Murdoch at 1:249/99.5
  84.   Compuserve:  71631,122
  85.   Postal:      337 Willingdon Ave,       (After June 19, 1992)
  86.                Kingston, Ontario, Canada
  87.                K7L 4J3
  88.