home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 24b / fixega.zip / FIXEGA.DOC
Text File  |  1986-09-23  |  4KB  |  149 lines

  1.  
  2.        NOTES ON PATCHING COLOR-GRAPHICS PROGS TO RUN
  3.        ON EGA CARD.
  4.  
  5. 1.  Problem is program doing OUTs to specific addr in the
  6.     COLOR- GRAPHICS CARD.
  7.  
  8. 2.  Procedure is to locate and NOP these and only these OUTs.
  9.  
  10. 3.  The addr on the CGA that causes the problem is:
  11.  
  12.     --03D4--
  13.  
  14. 4.  The OUT instrustion looks like this in assembler:
  15.  
  16.     OUT    DX,AL
  17.  
  18.     where for our problem DX has been previously loaded
  19.     with the fateful --03D4--.
  20.  
  21. 5.  This load usually takes the form of a MOV thusly ..
  22.     again in assembler:
  23.  
  24.     MOV   DX,03D4
  25.  
  26. 6.  Therefore before we can zap (nop) the offending OUT
  27.     we need to make sure it is guilty. We need to find
  28.     the MOV that fools around with DX and addr 03D4.
  29.     and follow the code from there to find the OUT instr.
  30.     logically following that MOV inst. This is usually
  31.     easy but look out for jumps that can change sequence.
  32.     Usually though the OUT occurs close to the MOV.
  33.  
  34. 7.  If the offending program was written in a "high" level
  35.     language the code pattern of the MOV , the OUT and
  36.     any instructions in-between are usually the same and
  37.     pretty straight forward.
  38.  
  39. 8.  OK .. the example of this unnecessary necessary nonsense
  40.     we will use is Gertrude's Puzzles. (Trade Mark of the
  41.     Learning Company)(Copyright the Learning Company)
  42.     Version 1.00 (Copyright IBM).
  43.  
  44. 9.  First you must become a licensed user of GP.(otherwise
  45.     you wouldn't have the problem..right ?)
  46.  
  47. 10. Next you must make a copy of this hummer that is
  48.     not Write protected but still is Copyprotected (as is
  49.     your licensed copy) DO THIS WORK ON THE COPY NOT THE ORIGINAL.
  50.     I had to say it.
  51.  
  52. 11. Now you must locate the offending progarm if there is
  53.     more than one candidate (and there are in this example).
  54.     This can be time consuming but not too difficult. (just
  55.     look for the   MOV     DX,03D4  instructions)
  56.     In our case it's simple. The name of the prog. is
  57.     COLORTST.EXE.
  58.  
  59. 12. So go read up on DEBUG (I had to) and join me in step 13.
  60.  
  61. 13.
  62.     Rename the EXE file to something DEBUG can handle, thusly.
  63.  
  64.       A>  rename colortst.exe colortst.x
  65.  
  66.     Start DEBUG against COLORTST.X
  67.  
  68.       A> debug colortst.x
  69.  
  70.     Debug responds:
  71.  
  72.       -                  (some response)
  73.  
  74.     Search for the hex pattern for the MOV DX,03D4 ....
  75.  
  76.       - s cs:0 ffff ba,d4,03      (0 ffff = top to bottom)
  77.  
  78.     Debug responds:
  79.  
  80.       xxxx:048C
  81.       xxxx:049E
  82.       xxxx:04B7
  83.       -
  84.  
  85.     Now lets go look for our OUT (it's simple this time)
  86.     We will unassemble a "window" of code to see if we can find
  87.     the OUT. ( I know where it is so our window will be small..
  88.     but you will probably need a larger amount of code unassembled
  89.     in other programs)
  90.  
  91.       - u 048C 048F      (tiny window)
  92.  
  93.     Debug responds:
  94.  
  95.       xxxx:048C   BAD403      MOV      DX,03D4
  96.       xxxx:048F   EE      OUT      DX,AL        <--- there it is !
  97.       -
  98.  
  99.     So let's git da little rascal !
  100.  
  101.       - e 048F  90          < be careful of your address and this will
  102.                     NOP your OUT not something else.
  103.     Debug responds:
  104.  
  105.       -
  106.  
  107.     Lets look to see if it worked ?
  108.  
  109.       - u 048C 048F
  110.  
  111.     Debug responds:
  112.  
  113.       xxxx:048C   BAD403      MOV      DX,03D$
  114.       xxxx:048C   90      NOP              <--- gottim !
  115.       -
  116.  
  117.     :  Now do the same for the other two addresses we found ..
  118.     :
  119.     :  remember ?..   xxxx:049E
  120.     :              xxxx:04B7
  121.     :
  122.     :  and you are almost done..
  123.  
  124.     Don't forget to WRITE OUT THE CHANGES  !
  125.     Tell debug:
  126.  
  127.       - w
  128.  
  129.     then quit Debug:
  130.  
  131.       - q
  132.  
  133.  
  134.     Now rename the COLORTST.X file to it's original name.
  135.  
  136.       A> rename colortst.x colortst.exe
  137.  
  138.     THAT's IT..  no guarantees but it worked for me.
  139.  
  140.  
  141. 14. OK thats that.. I know it's only one way to skin the cat
  142.     but maybe it will get the cat worried. Get those creative
  143.     juices flowing and find a better way .. Let the BBS's know
  144.     if you come up with patches to other programs that will
  145.     allow us EGA (spelled high tech) folks to use all that
  146.     software we bought for our kids when we had CGA cards.
  147.  
  148.     081885wzp.
  149.