home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / virus / virdet / virdet.asm next >
Encoding:
Assembly Source File  |  1990-07-05  |  1.4 KB  |  66 lines

  1.     name    VIRDET
  2.  
  3.     title    VIRDET -- detects the Jerusalem virus in RAM
  4. ;
  5. ;    Looks for the string: E9 92 00 73 55 4D, in RAM and returns with
  6. ;    errorlevel 1 if it finds it, otherwise returns with 0.
  7. ;
  8. START    segment    word public 'CODE'
  9.  
  10.     org    100h
  11.  
  12.     assume    CS:START,DS:START,SS:START
  13.  
  14. search    proc    near
  15.     mov    ax,0
  16.     mov    es,ax
  17. ;
  18. ;    Use ES as the segement for the target
  19. ;
  20.     cld            ;set to move forward
  21.     mov bx,-0ffeh        ;initialize search segment
  22.     mov ax,7000h        ;record current segment in AX
  23. init2:    add bx,0ffeh        ;increment search segment
  24.     cmp ax,bx        ;reached current segment?
  25.     jb passed        ;yes, then signature not found
  26.     mov es,bx        ;point ES to search segment
  27.     mov di,0        ;point DI to memory
  28.     mov al,intro        ;point SI to the string
  29.     mov cx,0ffffh        ;check 16 characters
  30. init3:    repne scasb        ;look for intro character
  31.     jne init2        ;continue search if compare failed
  32. ;
  33. ;    check for the rest of the string
  34. ;
  35.     cmp    cx,16
  36.     jb    init2        ;don't go over boundary
  37.     push    di        ;save the pointer
  38.     push    cx        ;save the counter
  39.     mov    cx,str_len
  40.     mov    si,offset str    ;remainder of string
  41.     repe    cmpsb        ;compare remainder of string
  42.     pop    cx
  43.     pop    di        ;restore if search must go on
  44.     jne    init3
  45. ;
  46. fail:    mov    ax,4c01h
  47.     int    21h    
  48.  
  49. passed:    mov    ax,4c00h
  50.     int    21h
  51.  
  52. search    endp
  53.  
  54. str    db    92h,0,73h,55h,4Dh    ;the rest of the string
  55. str_len    equ    $-str
  56.  
  57. intro    db    0e9h        ;the introductory character
  58.  
  59. START    ends
  60.  
  61.     end    search
  62.  
  63.  
  64.  
  65.     
  66.