04/07/97 How to make XCOPY work with all versions of DOS ******************************************************************************* Notes - My version of XCOPY is dated 30-Dec-85 (12-30-85), 12.00 PM. The filesize is 11200 bytes. If your copy is identical, the numbers which I give may be used in the patch. If not, follow the entire procedure, in order to find the correct locations. I have been using the patched version with DOS 3.1 for several months. It should also work with 3.0. I DO NOT recommend using the patched program with any version of DOS before 3.0 (ie, 1.0 2.0, 2.1...) I doubt that the former versions have certain necessary functions for XCOPY's use. Try it on a scratch disk - if it works, be happy - if it doesn't, invest in a copy of 3.1. ******************************************************************************* Follow the procesure shown below, using SYMDEB (or DEBUG, or your favorite) to patch the program file. I have used ANSI sequences to highlight what the you type. The computer's output will appear in normal text, yours will be in inverse-video. All segment addresses are for my computer only, and will probably change, depending on weather, trip distance, an how many resident programs you have in memory. The offsets, however, should remain constant. After the procedure is illustrated, I give an explanation of what's been done. C:>ren XCOPY.EXE XCOPY.XXX C:>symdeb xcopy.xxx Microsoft (R) Symbolic Debug Utility Version 4.00 Copyright (C) Microsoft Corp 1984, 1985. All rights reserved. Processor is [80286] -s ds:0000 ds:cx B4 30 2CFB:292A -u 2CFB:292A 2CFB:292A B430 MOV AH,30 2CFB:292C CD21 INT 21 2CFB:292E 86E0 XCHG AH,AL 2CFB:2930 3D1403 CMP AX,0314 2CFB:2933 7410 JZ 2945 2CFB:2935 8D16B022 LEA DX,[22B0] 2CFB:2939 B409 MOV AH,09 2CFB:293B CD21 INT 21 -a 2CFB:2933 2CFB:2933 jmp short 2945 2CFB:2935  -u 2CFB:292A 2CFB:292A B430 MOV AH,30 2CFB:292C CD21 INT 21 2CFB:292E 86E0 XCHG AH,AL 2CFB:2930 3D1403 CMP AX,0314 2CFB:2933 EB10 JMP 2945 2CFB:2935 8D16B022 LEA DX,[22B0] 2CFB:2939 B409 MOV AH,09 2CFB:293B CD21 INT 21 -w Writing 2CB0 bytes -q C:>ren XCOPY.XXX XCOPY.EXE ******************************************************************************* What this procedure actually does A - REN XCOPY.EXE XOPY.XXX The rename is needed to fool SYMDEB (or DEBUG or whatever) into thinking that we are patching a text file. Without the rename, it would think that we are debugging the file, fix all memory references, and later use would be impossible. B - The "s" and "u" commands: You are searching for the command MOV AH,30. This is the call to DOS which returns the version number. After you dissassemble the returned location, you can see that this version number is checked agains the the value 3.20 (high byte is 3, low byte is 20). If it is correct, a jump (JZ, Jump if Zero) skips the code which displays a nasty message and exits. C - The "a" command: With this, we replace the conditional jump by an unconditional jump. We then do another dissassembly, to confirm that we haven't trashed anything important. D - REN XCOPY.XXX XCOPY.EXE Makes it usable.