home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff338.lzh / SASTools / VirusTools / KillRLE.asm < prev    next >
Assembly Source File  |  1990-03-23  |  4KB  |  115 lines

  1. ****************************************************************************
  2. *  Programme : KillRLE.asm                                                 *
  3. *  Usage     : KillRLE                                                     *
  4. *  Version   : V1.00                                                       *
  5. *  Date      : 07.02.1990                                                  *
  6. *  Author    : Jörg Sixt                                                   *
  7. *  Purpose   : Checks and kills "Revenge of the Lamer Exterminator"        *
  8. *  Language  : A68K-Assembler,Blink from Fish 110                          *
  9. *  Bugs      : accept no arguments                                         *
  10. ****************************************************************************
  11.  
  12.              SECTION BEGIN,CODE
  13.  
  14. EXECBASE:    EQU      $4
  15. OPENLIBRARY: EQU     -$228
  16. CLOSELIBRARY: EQU    -$19E
  17. OUTPUT:      EQU     -$3C
  18. OPEN:        EQU     -$1E
  19. CLOSE:       EQU     -$24
  20. READ:        EQU     -$2A
  21. WRITE:       EQU     -$30
  22. SEEK:        EQU     -$42
  23. DELETEFILE:  EQU     -$48
  24. MODE_READWRITE: EQU    1004
  25. OFFSET_BEGINNING: EQU -$1
  26.  
  27. OPENLIB:     MACRO
  28.              lea      \1,a1
  29.              moveq    #0,d0
  30.              jsr      OPENLIBRARY(a6)
  31.              move.l   d0,\2
  32.              beq      \3
  33.              ENDM
  34. CLOSELIB:    MACRO
  35.              lea      \1,a1
  36.              jsr      CLOSELIBRARY(a6)
  37.              ENDM
  38. PRINT:       MACRO
  39.              move.l   Outhandle,d1
  40.              move.l   \1,d2
  41.              move.l   \2,d3
  42.              jsr      WRITE(a5)
  43.              ENDM
  44.  
  45. Begin:       move.l   EXECBASE,a6
  46.              OPENLIB  Dosname,a5,#End
  47.              jsr      OUTPUT(a5)
  48.              move.l   d0,Outhandle
  49.              beq      End
  50.  
  51.              move.l   #sssName,d1
  52.              move.l   #MODE_READWRITE,d2
  53.              jsr      OPEN(a5)
  54.              move.l   d0,d1
  55.              beq      openError
  56.              move.l   d0,handle
  57.              move.l   #Buffer,d2
  58.              move.l   #5,d3
  59.              jsr      READ(a5)
  60.  
  61.              lea      RLE,a0
  62.              lea      Buffer,a1
  63.              move.l   #4,d0
  64. CompareLoop: cmpm.b   (a0)+,(a1)+
  65.              bne      sssClose
  66.              dbf.s    d0,CompareLoop
  67.  
  68.              PRINT    #RLEMess,#101
  69.              move.l   handle,d1
  70.              move.l   #0,d2
  71.              move.l   #OFFSET_BEGINNING,d3
  72.              jsr      SEEK(a5)
  73.  
  74.              move.l   handle,d1
  75.              move.l   #KillBuf,d2
  76.              move.l   #5,d3
  77.              jsr      WRITE(a5)
  78.              cmp.l    #5,d0
  79.              bne      killError
  80.  
  81.              move.l   #VirName,d1
  82.              jsr      DELETEFILE(a5)
  83.              tst.l    d0
  84.              beq      killError
  85.  
  86. sssClose:    move.l   handle,d1
  87.              jsr      CLOSE(a5)
  88.  
  89. End:         move.l   #0,d0
  90.              rts
  91.  
  92. openError:   PRINT    #openErrMess,#29
  93.              bra      End
  94. killError:   PRINT    #killErrMess,#18
  95.              bra      sssClose
  96.  
  97.              SECTION  VARS,BSS
  98.              even
  99. Outhandle:   ds.l     1
  100. handle:      ds.l     1
  101. Buffer:      ds.b     5
  102.  
  103.              SECTION  CONST,DATA
  104.              even
  105. Dosname:     dc.b     'dos.library',0
  106. sssName:     dc.b     ':s/startup-sequence',0
  107. VirName:     dc.b     ':'
  108. RLE:         dc.b     $A0,$A0,$A0,$A0,$A0,0
  109. RLEMess:     dc.b     'The disk is infected with the "Revenge of the',10
  110.              dc.b     'Lamer Exterminator". I kill him now. Make a reset then',10
  111. KillBuf:     dc.b     $20,$20,$20,$20,$20
  112. openErrMess: dc.b     'Can`t open startup-sequence!',10
  113. killErrMess: dc.b     'Can`t kill virus!',10
  114.              END
  115.