发信人: solarlight()
整理人: emil(2000-06-24 14:32:30), 站内信件
|
1575病毒演示程序
概述:
该程序是1575病毒演示程序,它主要通过修改硬件定时中断(中断类型号8)将其 设置到本程序的
地址在运行忘本程序之后在运行原中断服务程序来达到程序执行的效果.
源程序:
;**************************************************************
;This structure is for compiling ".com" file
;**************************************************************
code_seg segment
org 100h
assume cs:code_seg,ds:code_seg,es:code_seg,ss:code_seg
;------------------------------------------------------
main proc far
mov ah,35h
mov al,8
int 21h
lea si,bios_int8
mov word ptr[si],bx
mov word ptr[si+2],es ;save bios_int8
mov ah,25h
mov al,8
lea dx,run ;the current ds is psp segment address
int 21h ;set new bios_int8
mov ah,31h
mov al,0 ;return code
mov dx,((prg_len+15)/16)+10h;resident memory paragraphs length
int 21h ;exit & stay resident
main endp
;-------------------------------------------------
run proc far
push ax
push bx
push cx
push dx
push si
push di
push bp
push ds
push es
mov ah,3
mov bh,0
int 10h
push dx ;save original cursor position
mov ch,00010000b
mov cl,0
mov ah,1
int 10h ;close cursor display function
call display1
call save_old
call modify_new
call delay
call erase
mov ah,2
mov bh,0
pop dx
int 10h ;restore original cursor positi on
mov ch,00000111b
mov cl,00001000b
mov ah,1
int 10h ;enable cursor display function
pop es
pop ds
pop bp
pop di
pop si
pop dx
pop cx
pop bx
pop ax
jmp cs:bios_int8
run endp
;------------------------------------------------------
display1 proc near
push ax
push bx
push cx
push dx
push si
push di ;save register
mov ax,cs
mov ds,ax
mov cx,2 ;display twice
display_head:
mov dh,new_row ;set raw
mov dl,new_col ;set column
mov bh,0 ;set display page
mov ah,2
int 10h ;set new cursor position
mov si,offset char_buf
add si,flag ;select character
xor flag,0001h ;prepare flag for next time
mov bh,0
mov al,byte ptr[si] ;set character
mov bl,0001100b ;set color
push cx ;save cx
mov cx,1 ;set display times
mov ah,9
int 10h ;display 1st character
mov si,offset new_row ;set raw
inc si
mov dh,[si]
mov di,offset new_col ;set column
inc di
mov dl,[di]
mov bh,0 ;set display page
mov ah,2
int 10h ;set new cursor position
mov al,neck ;set character
mov bh,0 ;set display page
mov cx,1
mov bl,00001110b ;set color
mov ah,9
int 10h ;display neck
mov cx,7
mov si,offset new_row
add si,2
mov di,offset new_col
add di,2
display_tail:
mov dh,byte ptr[si] ;set row
mov dl,byte ptr[di] ;set column
mov bh,0 ;set display page
mov ah,2
int 10h ;set new cursor position
mov bh,0 ;set display page
mov al,15 ;set character
mov bl,00001010b ;set color
push cx ;save cx register
mov cx,1
mov ah,9
int 10h ;display one tail element
pop cx
inc si
inc di
dec cx
jnz display_tail
pop cx ;fetch display times
dec cx
call delay ;delay a while
jnz display_head
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
display1 endp
;--------------------------------------------------
erase proc near
push ax
push bx
push cx
push dx
push si
push di ;save registers
mov ax,cs
mov ds,ax
mov si,offset old_row
mov di,offset old_col
mov cx,9
set_cur_erase:
mov bh,0 ;set display page
mov dh,byte ptr[si] ;set row
mov dl,byte ptr[di] ;set column
mov ah,2
int 10h ;set new cursor position
mov bh,0 ;set display page
mov al,' ' ;set character
mov bl,0 ;set display color=black:black
push cx ;set cx register
mov cx,1 ;set display times
mov ah,9
int 10h ;erase one character
pop cx
inc si ;next row
inc di ;next column
dec cx
jnz set_cur_erase
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
erase endp
;-----------------------------------------------
;This procedure generates a one_quarter second delay
delay proc near
push cx
push dx
;mov dx,25
mov dx,400
d1:
mov cx,2801
d2:
loop d2
dec dx
jnz d1
pop cx
pop dx
ret
delay endp
;----------------------------------------------------
;This procedure modifys new_row & new_col
modify_new proc near
push cx
push si
push di ;save register
mov ax,cs
mov ds,ax
mov si,offset new_row ;si=address of new_row
mov di,offset new_col ;di=address of new_col
mov cx,9
modify_again:
cmp byte ptr[di],79
je mod1
inc byte ptr[di]
jmp mod3
mod1:
mov byte ptr[di],0
cmp byte ptr[si],24
je mod2
inc byte ptr[si]
jmp mod3
mod2:
mov byte ptr[si],0
mod3:
inc si
inc di
dec cx
jnz modify_again
pop di
pop si
pop cx
ret
modify_new endp
;---------------------------------------------------
;This procedure copys (new_row,new_col) to (old_row,old_col)
save_old proc near
push ax
push si
push di ;save registers
mov ax,cs
mov ds,ax
mov si,offset new_row
mov di,offset old_row
mov cx,9
copy_row:
mov al,byte ptr[si]
mov byte ptr[di],al
inc si
inc di
dec cx
jnz copy_row ;copy row
mov si,offset new_col
mov di,offset old_col
mov cx,9
copy_col:
mov al,byte ptr[si]
mov byte ptr[di],al
inc si
inc di
dec cx
jnz copy_col ;copy column
pop di
pop si
pop ax
ret
save_old endp
;------------------------------------------------
char_buf db 238,240 ;two head character
neck db 247 ;neck charcter
flag dw 0 ;a flag to specify head charact er
old_row db 9 dup(0) ;9 old character position
old_col db 9 dup(0) ;(old_row[i],old_col[i])
new_row db 9 dup(0) ;9 new character position
; new_col db 9 dup(0) ;(new_row[i],new_col[i])
new_col db 8,7,6,5,4,3,2,1,0
bios_int8 dd ?
counter db 0
prg_len equ $-main
;--------------------------------------------------
code_seg ends
end main
作者:David Chu E-mail:[email protected] (http://solarlight.yeah.net)
欢迎来上述网站看看
-- ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.101.193.157]
|
|