home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / reference / amiga_mail_vol1 / misc / amigavirus next >
Text File  |  1990-01-26  |  6KB  |  142 lines

  1. (c)  Copyright 1989 Commodore-Amiga, Inc.   All rights reserved.
  2. The information contained herein is subject to change without notice, and 
  3. is provided "as is" without warranty of any kind, either expressed or implied.  
  4. The entire risk as to the use of this information is assumed by the user.
  5.  
  6.  
  7.                         THE AMIGA VIRUS
  8.                           Bill Koester
  9.  
  10.  
  11.  
  12. Definition
  13. ----------
  14.  
  15.    The Amiga virus is simply a modification of the boot block of an existing
  16. DOS boot disk. Any disk that can be used to boot the Amiga (ie workbench)
  17. has a reserved area called the boot block. On an Amiga floppy the bootblock
  18. consists of the first two sectors on the disk. Each sector is 512 bytes long
  19. so the boot block contains 1024 bytes. When KickStart is bringing up the
  20. system the disk in drive 0 is checked to see if it is a valid DOS boot disk.
  21. If it is, the first two sectors on the disk are loaded into memory and
  22. executed. The boot block normally contains a small bit of code that loads
  23. and initializes the DOS. If not for this boot code you would never see the
  24. initial CLI. The normal boot code is very small and does nothing but call
  25. the DOS initialization. Therefore, on a normal DOS boot disk there is plenty
  26. of room left.
  27.  
  28.  
  29.    The virus is a replacement for the normal DOS boot code. In addition to
  30. performing the normal DOS startup the virus contains code for displaying
  31. the virus message and infecting other disks. Once the machine is booted from
  32. an infected disk the virus remains in memory even after a warm start since
  33. the warm start routine is "infected" too.  Instead of going through the normal
  34. startup, the virus checks the boot disk in df0: for itself. If the virus in 
  35. memory sees that the boot block is not infected it copies itself onto the 
  36. boot block over-writing any code that was there before. It is in this manner 
  37. that the virus propagates from one disk to another. After a certain number of 
  38. disks have been infected the virus will print a message telling you that
  39. "something wonderful" has happened.
  40.  
  41.  
  42. Dangers
  43. -------
  44.  
  45.    When the virus infects a disk the existing boot block is over-written.
  46. Since some commercial software packages, especially games, store special
  47. information in the boot block the virus could damage these disks. When the
  48. boot block is written with the virus, any special information is lost
  49. forever. 
  50.  
  51.  
  52. Mechanics
  53. ---------
  54.  
  55.    Here is a more detailed description of how the virus works - please use 
  56. this information for learning and understanding only.  Do not use it to 
  57. create more virus problems in the Amiga community.
  58.  
  59.  
  60. Infiltration
  61.  
  62. This is the first stage of viral infection. The machine is brought up normally
  63. by reading the boot block into memory. When control is transferred to the boot
  64. block code, the virus code immediately copies the entire boot block to $7EC00.
  65. It then JSR's to the copied code to wedge into the CoolCapture vector.  Once
  66. wedged in, control returns to the loaded boot block which performs the normal 
  67. DOS initialization. Control is then returned to the system.
  68.  
  69. Hiding Out
  70.  
  71. At this point the system CoolCapture vector has been replaced and points to 
  72. code within the virus. When control is routed through the CoolCapture vector 
  73. the virus first checks for the left mouse button, if it is down the virus 
  74. clears the CoolCapture wedge and returns to the system. If the left mouse 
  75. button is not pressed the virus replaces the DoIO code with its own version 
  76. of DoIO and returns to the system.
  77.  
  78. Spreading
  79.  
  80. The code so far has been concerned only with making sure that at any given 
  81. time the DoIO vector points to virus code. This is where the real action takes
  82. place. On every call to DoIO the virus checks the io_Length field of the IOB 
  83. if this length is equal to 1024 bytes then it could possibly be a request to 
  84. read the boot block. If the io_Data field and A4 point to the same address
  85. then we know we are in the strap code and this is a boot block read request. 
  86. If this is not a boot block read the normal DoIO vector is executed as if the 
  87. virus was not installed. 
  88.  
  89. If we are reading the boot block we JSR to the old DoIO code to read the boot 
  90. block and then control returns to us. After reading, the checksum for the 
  91. virus boot block is compared to the checksum for the block just read in. 
  92. If they are equal this disk is already infected and the code returns.  If 
  93. they are not equal a counter is incremented and the copy of the virus at 
  94. $7EC00 is written to the boot block on the disk. If the counter ANDed with 
  95. $F is equal to 0, then a rastport and bitmap are constructed and the message
  96. is displayed.
  97.  
  98.  
  99. The Message
  100.  
  101.             < Something wonderful has happened >
  102.                  < Your AMIGA is alive!!! >
  103.                     < and even better >
  104.          < Some of your disks are infected by a VIRUS >
  105.          < Another masterpiece of the Mega-Mighty SCA >
  106.  
  107.  
  108. Prevention
  109. ----------
  110.  
  111. How do you protect yourself from the virus?
  112.  
  113.       1) Never warm start the machine, always power down first.
  114.          This works but is not very practical.
  115.  
  116.       2) Always hold down the left mouse button when rebooting.
  117.          This also works, but only with the current SCA virus since 
  118.          it checks for mouse presses.  Future viruses may not.
  119.  
  120.       3) Obtain a copy of VCheck1.2 and check all disks before use.
  121.          VCheck1.2 is posted on Usnet and BIX.
  122.  
  123.       4) If you can't get a copy of VCheck, then use a sector editor
  124.          like SectORama (Fish Disk #108, #102) to check the boot block
  125.          for virus text.
  126.  
  127. Treatment
  128. ---------
  129.  
  130. The virus can be removed from an infected disk by using the DOS Install command
  131. which will put standard boot code in the boot block.  Be careful though, the
  132. Install command will over-write any code that was there.  You should only use
  133. Install on a DOS boot disk. Applications, especially games, may have a custom
  134. boot block which will be destroyed by the Install command.
  135.  
  136. If you have an infected game disk, then chances are the boot block is already
  137. corrupted so you have nothing to lose by trying the Install command.  You could s
  138. also try returning the disk to the publisher for a new copy if they have a
  139. policy of replacing faulty disks.  If you do this, clearly mark the disk with
  140. the word virus so no one else is infected.
  141.  
  142.