

NOVELL TECHNICAL INFORMATION DOCUMENT

DOCUMENT PROCESSING INFO:  THIS DOCUMENT REPLACES FYI-M-1114
TITLE:  Using SID instead of DEBUG to create a patch
DOCUMENT ID:  TID800039
DOCUMENT REVISION:  A
DATE:  16AUG94
AUTHOR:  KBANTA;CEREKSON
ALERT STATUS:  Yellow
DISTRIBUTION:  Public
INFORMATION TYPE:  Symptom Solution
README FOR:  NA
NOVELL PRODUCT CLASS:

Desktop Products

NOVELL PRODUCT and VERSION:

DR DOS 6.0

CATEGORY:

Kernel

ABSTRACT:

NA

-----------------------------------------------------------------
DISCLAIMER
THE ORIGIN OF THIS INFORMATION MAY BE INTERNAL OR EXTERNAL TO NOVELL. 
NOVELL MAKES EVERY EFFORT WITHIN ITS MEANS TO VERIFY THIS INFORMATION. 
HOWEVER, THE INFORMATION PROVIDED IN THIS DOCUMENT IS FOR YOUR INFORMATION
ONLY.  NOVELL MAKES NO EXPLICIT OR IMPLIED CLAIMS TO THE VALIDITY OF THIS
INFORMATION.
-----------------------------------------------------------------

SYMPTOM

CONFUSION BETWEEN SID & DEBUG COMMANDS

ISSUE/PROBLEM

Software manufacturers occasionally make changes to their software after
it has been released to customers.  Usually these are small changes to the
instructions that make up the software, sometimes effecting only 1 or 2
bytes out of the entire program.  Since the changes are so small, they can
often be  completed  by  the customer by following a patch listing  from 
the manufacturer. These patch listings depend on the use of DEBUG.  A
typical patch listing could look like this:

1) COPY BROKFILE.EXE BROKFILE.SAV
2) DEBUG BROKFILE.EXE
3) -S 100 L FFFF B2 01 7C 56 8B 1E
4) -E xxxx:yyyy 91 92 93 94 88 1F
5) -W
6) -Q

DR DOS has a similar utility called SID.  While the function of the two
applications is the same, the actual commands are a little different. 
What follows is a typical DEBUG listing, its SID equivalent and a
description of each step.

STEP 1, DEBUG COMMAND LINE:   COPY BROKFILE.EXE BROKFILE.BAK
STEP 1, SID COMMAND LINE:     same command

STEP 1, DESCRIPTION:

  Just in case things do not go asplanned, make a backup

STEP 2, DEBUG COMMAND LINE:   DEBUG BROKFILE.EXE
STEP 2, SID COMMAND LINE:     SID
                              #RBROKFILE.EXE,100

STEP 2, DESCRIPTION:

DEBUG is loading and reading the subject file into memory. To accomplish
this in SID, type SID at the command line and then use the R command to
read the subject file into memory starting at memory offset address 100.
SID will display the starting and ending address of the file in memory in
a SEGMENT:OFFSET format. Note these addresses.

STEP 3, DEBUG COMMAND LINE:   -S 100 L FFFF B2 01 7C 56 8B 1E
STEP 3, SID COMMAND LINE:     #SR100,FFFF,B2 01 7c 56 8B 1E

STEP 3, DESCRIPTION:

 DEBUG is searching from the offset address 100 to the last address of
FFFF (a hexadecimal number) for the pattern of bytes listed (B2 01 7C 56
8B 1E).  This is a pattern that is unique to the area or areas of the file
that need to be changed. DEBUG will return the addresses of the desired
patterns in a SEGMENT:OFFSET format like 2345:1DF5. The specific values
returned will vary. There may be more than one found. The patch listing
will usually refer to these values as 'xxxx:yyyy'. The  SID SR command is
very similar. Some  of  the arguments are separated with commas instead of 
spaces. The  address  or addresses that  contain  the  desired pattern
will be returned in the same xxxx:yyyy  format. Record the addresses
returned.

STEP 4, DEBUG COMMAND LINE:   -E xxxx:yyyy 91 92 93 94 88 1F
STEP 4, SID COMMAND LINES:    #Sxxxx:yyyy
                              xxxx:yyyy B2 91
                              xxxx:yyyz 01 92
                              xxxx:yyya 7C 93
                              xxxx:yyyb 56 94
                              xxxx:yyyb 8B 88
                              xxxx:yyyb 1E 1F
                              xxxx:yyyb 22 .
                              #

STEP 4, DESCRIPTION:

  DEBUG is entering new values for the bytes in memory.  This is how the
software is actually changed.  The xxxx:yyyy is the address at which the
new values should be added.  The following numbers are the new values
themselves.  In SID, use the S command and specify where the new values
should start.  SID will display that starting address and the current
value in memory and be waiting for the new value. Enter the first value
listed after xxxx:yyyy in the -E command line of the patch listing.  Press
Enter.  SID will now show the next address and its current value and be
waiting for the new value.  Enter the next value in the DEBUG -E command
line. Continue entering the remaining values.  After the last value has
been entered, SID will display the next address and be waiting for a new
value. Simply enter a '.' and press ENTER.  SID will return to its '#'
prompt.

STEP 5, DEBUG COMMAND LINE:   -W
STEP 5, SID COMMAND LINE:     #WBROKFILE.EXE

STEP 5, DESCRIPTION:

The updated version of the software is written from memory to the original
file name. In SID use the W command followed by the filename.

STEP 6, DEBUG COMMAND LINE:   -Q
STEP 6, SID COMMAND LINE:     #Q

STEP 6, DESCRIPTION:

You're done. Quit. SID's command is the same.

The following example shows what this patch looks like using SID.

[DR DOS] C:\MYFILES>SID
--------------------------------------------------
*** Symbolic Instruction Debugger ***  Release 3.2
      Copyright (c) 1983,1984,1985,1988,1990,1991
    Digital Research, Inc. All Rights Reserved
--------------------------------------------------

#RBROKFILE.EXE,100
  Start      End
1056:0100 2056:7BF2
#SR100,FFFF,B2 01 7C 56 8B 1E
1056:2344
#S1056:2344
1056:2344 B2 91
1056:2345 01 92
1056:2346 7C 93
1056:2347 56 94
1056:2348 8B 88
1056:2349 1E 1F
1056:234A B8 .
#WBROKFILE.EXE
#Q

[DR DOS] C:\MYFILES>

-----------------------------------------------------------------
Any trademarks referenced in this document are the property of their
respective owners.  Consult your product manuals for complete trademark
information.
-----------------------------------------------------------------
