HDKPR.ASM
资源名称:schdgurd.zip [点击查看]
上传用户:yugezi
上传日期:2007-01-06
资源大小:18k
文件大小:3k
源码类别:
磁盘编程
开发平台:
Others
- code segment
- assume cs:code,ds:code,es:code
- org 100h
- begin:jmp start
- cyl dw 0
- rint13 dw 0,0
- myint13:
- push ax
- push cx
- cmp dl,80h
- jnz int13
- cmp ah,03
- jz IsWrite
- cmp ah,05
- jz IsWrite
- cmp ah,0bh
- jz IsWrite
- int13:
- pop cx
- pop ax
- jmp dword ptr cs:rint13
- IsWrite:
- mov al,cl
- mov cl,6
- shr al,cl
- mov cl,ch
- mov ch,al
- cmp cx,cs:cyl
- jnb int13
- pop cx
- pop ax
- xor ax,ax
- iret
- SetupROD:
- mov ax,201h
- mov bx,offset buffer
- mov cx,1
- mov dx,80h
- int 13h
- mov cl,6
- mov ch,[bx+01c4h]
- shr ch,cl
- mov cl,[bx+01c5h]
- mov cyl,cx
- mov ax,3513h
- int 21h
- mov rint13,bx
- mov bx,es
- mov rint13+2,bx
- mov dx,offset myint13
- mov ax,2513h
- int 21h
- mov dx,offset SetupROD
- int 27h
- message db 'HD LOCK already Installed!',07,0dh,0ah,'$'
- buffer db 256 dup(0)
- prompt1 db 0ah,0dh,'Enter new'
- password db 'Password:$'
- change db 0ah,0dh,'Change password?(Y/N)$'
- secret db 'cheguanghong',0
- pwbuff db 13 dup(0)
- filename db 'c:dosrohd.com',0
- start:
- push si
- push di
- mov ax,3513h
- int 21h
- push cs
- pop es
- mov dx,offset myint13
- cmp bx,dx
- jnz Cont
- mov dx,offset message
- mov ah,9
- int 21h
- jmp exit
- Cont:mov dx,offset password
- mov ah,9
- int 21h
- mov bx,0
- loop1:
- mov ah,07
- int 21h
- cmp al,0dh
- jz EndEnter
- cmp bx,11
- ja loop1
- mov pwbuff[bx],al
- inc bx
- jmp loop1
- EndEnter:
- mov cx,12
- mov si,offset secret
- mov di,offset pwbuff
- repz cmpsb
- jcxz ok1
- jmp SetupROD
- ok1: mov dx,offset change
- mov ah,09
- int 21h
- mov ah,01
- int 21h
- cmp al,'Y'
- jz ToChange
- cmp ah,'y'
- jz ToChange
- jmp exit
- ToChange:
- mov dx,offset prompt1
- mov ah,9
- int 21h
- mov bx,0
- loop2:
- mov ah,07
- int 21h
- cmp al,0dh
- jz loop4
- mov pwbuff[bx],al
- inc bx
- cmp bx,12
- jb loop2
- loop4:
- mov al,0
- mov pwbuff[bx],al
- inc bx
- cmp bx,12
- jb loop4
- mov dx,offset filename
- mov ax,3d02h
- int 21h
- mov bx,ax
- mov cx,0
- mov dx,offset secret-100h
- mov ax,4200h
- int 21h
- mov ah,40h
- mov cx,12
- mov dx,offset pwbuff
- int 21h
- mov ah,3eh
- int 21h
- exit:pop di
- pop si
- int 20h
- code ends
- end begin