//--DOS死機客星,能打破程式死迴圈,按住Ctrl +Esc即可使死掉的程式立即返回到Dos Shell
code segment
assume cs:code,ds:code
org 100h
start: jmp install
oldint dd 100h dup(?)
oldmcb dd 10h dup(?)
oldint2f dd ?
oldint09 dd ?
oldint21 dd ?
sign db 0
newint21: cmp ah,0ah
jnz newint21end
mov cs:byte ptr sign,0ffh
pushf
call cs:oldint21
mov cs:byte ptr sign,0
retf 2
newint21end: jmp cs:oldint21
newint2f: cmp ah,98h
jz lop1
jmp cs:oldint2f
lop1: mov al,98h
iret
newint09: push ax
in al,60h
cmp al,01
jz lop2
exit: pop ax
jmp cs:oldint09
lop2: mov ah,02h
int 16h
and al,0100b
jz exit
mov al,cs:byte ptr sign
cmp al,0ffh
jz exit
lop4: in al,61h
or al,80h
out 61h,al
and al,7fh
out 61h,al
mov al,20h
out 20h,al
mov ax,cs
mov ds,ax
dec ax
mov es,ax
xor di,di
mov si,offset oldmcb
mov cx,10h
cld
rep movsb
mov si,offset oldint
xor ax,ax
mov es,ax
xor di,di
mov cx,200h
cli
cld
rep movsw
sti
push cs
pop bx
mov ah,50h
int 21h
mov dx,offset word1
mov ah,09h
int 21h
mov dx,offset install
mov ah,31h
int 21h
word1: db 10,13,7,' Goback has let your computer come to life!$'
word2: db 10,13,7,' Goback has installed! Only press Ctrl+Esc,when the computer is dead!$'
word3: db 10,13,' Goback installed ok!'
db 10,13,7,' Ver 1.0 Author: Zhao jibin 1998.7.29 '
DB 10,13,' When your computer is dead....'
db 10,13,' You need to press Ctrl+Esc come to life....',10,13,'$'
install: mov ah,98h
int 2fh
cmp al,98h
jnz lop3
mov dx,offset word2
mov ah,09h
int 21h
mov ah,04ch
int 21h
lop3: push cs
pop ds
mov ax,352fh
int 21h
mov word ptr oldint2f,bx
mov word ptr oldint2f+2,es
mov ax,3509h
int 21h
mov word ptr oldint09,bx
mov word ptr oldint09+2,es
mov ax,3521h
int 21h
mov word ptr oldint21,bx
mov word ptr oldint21+2,es
mov ax,252fh
mov dx,offset newint2f
int 21h
mov ax,2509h
mov dx,offset newint09
int 21h
mov ax,2521h
mov dx,offset newint21
int 21h
push cs
pop es
xor ax,ax
mov ds,ax
xor si,si
mov di,offset oldint
mov cx,200h
cld
rep movsw
mov ax,cs
dec ax
mov ds,ax
xor si,si
mov di,offset oldmcb
mov cx,10h
cld
rep movsb
push cs
pop ds
mov dx,offset word3
mov ah,09h
int 21h
mov dx,offset install+120h
mov cl,04h
shr dx,cl
mov ah,31h
int 21h
code ends
end start