home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / batutil / echooff.pat < prev    next >
Internet Message Format  |  1994-03-04  |  4KB

  1. From: bobmon@iuvax.cs.indiana.edu (RAMontante)
  2. Subject: THE Patches for Echo-off
  3. Summary: the strings to look for in command.com
  4.  
  5. I am one of those who think the MS-DOS default for displaying lines in
  6. a batch file is S-T-U-P-I-D.  (Well, that makes it consistent, anyway :-)
  7. I understand they've compensated somewhat in v3.3, with a kludge that
  8. requires changing each and every .BAT file....oh boy.
  9.  
  10. Anyway, for those of you who would rather correct the original mistake
  11. than cover it with bandaids, here are two (simple) patches to
  12. COMMAND.COM to make echo-off the default.  Use debug or something
  13. equivalent to find the following byte strings, then change the bytes.
  14. The strings I suggest are near the important bytes, and have been
  15. unchanged in MS-DOS v2.11, v3.10, and v3.21 (as released by Zenith); as
  16. far as I know the PC-DOS versions are the same, but the addresses
  17. involved change by quite a bit.  The disassembled context is included so
  18. that you can be sure you've found the right places.
  19.  
  20. ----
  21. To make echo-off the default for all batch files _except_ AUTOEXEC.BAT,
  22.     search for:  00 bb 03 00 b4 48 cd 21
  23.     ten bytes later, change 03 to 02
  24.  
  25. ----
  26. To make echo-off the default for AUTOEXEC.BAT,
  27.     search for:  24 01 50 e8 96 00
  28.     change the second byte, 01, to 00
  29. or
  30.     search for: 81 c3 b8 00
  31.     thirteen bytes previous, change 01 to 00
  32.  
  33. ----------
  34. enjoy and as always -- Caveat Hacker,
  35.     Bob Montante
  36.  
  37.  
  38. DOS Echo-Off Patches -- debug transcript
  39. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40. C:\MISC debug c2.com        { patch a _copy_ of command.com }
  41. -
  42. -
  43. -{ ECHO OFF default for .BAT files, except AUTOEXEC.BAT }
  44. -
  45. -s cs:100 2000 00 bb 03 00 b4 48 cd 21        { search for an 8-byte string }
  46. 5BE4:122D
  47. -
  48. -u 122d
  49. 5BE4:122D 00BB0300      ADD     [BP+DI+0003],BH      { the           }
  50. 5BE4:1231 B448          MOV     AH,48                {   search      }
  51. 5BE4:1233 CD21          INT     21                   {       string  }
  52. 5BE4:1235 7271          JB      12A8
  53. 5BE4:1237 A37B0B        MOV     [0B7B],AX
  54. 5BE4:123A C606D00B03    MOV     BYTE PTR [0BD0],03   <-- change to 02
  55. 5BE4:123F 8EC0          MOV     ES,AX                    ~~~~~~~~~~~~
  56. 5BE4:1241 33FF          XOR     DI,DI
  57. 5BE4:1243 B000          MOV     AL,00
  58. 5BE4:1245 AA            STOSB
  59. 5BE4:1246 33C0          XOR     AX,AX
  60. 5BE4:1248 AB            STOSW
  61. 5BE4:1249 AB            STOSW
  62. 5BE4:124A B8FFFF        MOV     AX,FFFF
  63. -
  64. -e 123e
  65. 5BE4:123E  03.02                             { make the change }
  66. -
  67. -
  68. -
  69. -{ ECHO OFF default for AUTOEXEC.BAT            }
  70. -{ alternate search:  -scs:100 2000 81 c3 b8 00 }
  71. -
  72. -s cs:100 2000 24 01 50 e8 96 00
  73. 5BE4:1BBB
  74. -
  75. -u 1bb0
  76. 5BE4:1BB0 06            PUSH    ES
  77. 5BE4:1BB1 E88C1A        CALL    3640
  78. 5BE4:1BB4 E86AFF        CALL    1B21
  79. 5BE4:1BB7 26            ES:
  80. 5BE4:1BB8 A0D00B        MOV     AL,[0BD0]
  81. 5BE4:1BBB 2401          AND     AL,01        <-- change to 00
  82. 5BE4:1BBD 50            PUSH    AX               ~~~~~~~~~~~~
  83. 5BE4:1BBE E89600        CALL    1C57         { search string ends here }
  84. 5BE4:1BC1 BEAB3D        MOV     SI,3DAB
  85. 5BE4:1BC4 E8D415        CALL    319B
  86. 5BE4:1BC7 8BD9          MOV     BX,CX
  87. 5BE4:1BC9 81C3B800      ADD     BX,00B8      { alternate search string }
  88. 5BE4:1BCD 51            PUSH    CX
  89. 5BE4:1BCE B104          MOV     CL,04
  90. -
  91. -e 1bbc
  92. 5BE4:1BBC  01.00                             { make the change }
  93. -
  94. -w
  95. -q
  96. C:\MISC
  97. __________________________________________________________________________
  98.  
  99. version           \AUTOEXEC.BAT   other.BAT   25-line CLS   echo<space>
  100. ~~~~~~~           ~~~~~~~~~~~~~   ~~~~~~~~~   ~~~~~~~~~~~   ~~~~~~~~~~~
  101.       patches         01 -> 00     03 -> 02     19 -> 18    e8200074 -> 83f90172
  102.  
  103. Location Offsets (per John Wright)
  104. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105. MSDOS 3.10
  106.   IBM/Compaq/generic      105B         1967         263B           3878
  107.   Zenith (early?)          ??          1987                         ??
  108.   Zenith (IO.SYSv3.12)    112B         19C7         269B           38E8  *
  109.  
  110. MSDOS 3.20
  111.   generic                 115E         1ABC                        3A18
  112.   Compaq                  11A4         1B6C                        3AC8
  113.   Zenith v3.21            1bbc         123e                         ??   *
  114.   IBM (PCDOS 3.20)        115E         1B2C                        3A88
  115.  
  116. PCDOS 3.30 (IBM)          1304         1B6C                        3E29
  117.  
  118. --
  119. * "echo ." is known to work for this version
  120. _____________________________________________________________________________
  121.