Area: Quik_Bas Msg: #536 Date: 06-16-92 14:05 (Public) From: Steve Gartrell To: All Subject: Easier to get...
;Another way to defeat CTRL-ALT-DEL. Much more
;boring, to me at least. Works as is without
;modifying the previously posted QB/PDS source
;code 'cuz ALT-DEL doesn't generate a scan
;code...|-}
.MODEL MEDIUM, basic
.CODE
PUBLIC BASIC restvect, setvect
NoSoftBoot PROC FAR
EXTRN SetUevent:PROC
jmp SHORT @F
Old09Int dd 90909090h ;; Storage for
;; offset and seg
;; of old 09h int
@@: push bp
push ax
push es
push bx
pushf
in al, 60h ;; Check keyboard for delete key
cmp al, 53h
jne SHORT skip ;; Ain't-back to key handler
mov bx, 0
mov es, bx
mov bx, 417h
mov al, es:[bx]
and al, 0Ch
cmp al, 0Ch ;; Check for CTRL and ALT pressed
jne SHORT skip ;; Uh-oh....
and al, 0FBh ;; Turn the control key off-turning
mov es:[bx], al ;; alt off generates a scan code
;; which you don't want...
push dx
push cx
call SetUevent ;;Set user event flag
pop cx
pop dx
skip: popf
pop bx
pop es
pop ax
pop bp
jmp cs:Old09Int
NoSoftBoot ENDP
setvect PROC FAR
push bp
push ax
push bx
push dx
push ds
push es
pushf
@@: mov ax, 0100h ;; Flush the keyboard
int 16h ;; buffer before
jz @F ;; changing the 09h
xor ax, ax ;; interrupt vector
int 16h
jmp @B
@@: mov ax, 3509h ;; Load Get vector
int 21h ;; DOS interrupt
mov WORD PTR cs:Old09Int, bx ;; Save the offset
mov WORD PTR cs:Old09Int +2, es ;; Save the segment
push cs ;; Code seg to DS
pop ds
lea dx, NoSoftBoot ;; Get handler offset
mov ax, 2509h ;; Load set handler
int 21h ;; DOS interrupt
popf
pop es
pop ds
pop dx
pop bx
pop ax
pop bp
ret
setvect ENDP
restvect PROC FAR
push bp
push ax
push bx
push ds
lds dx, cs:Old09Int ;; Restore original
;; key handler by
mov ax, 2509h ;; calling DOS set
int 21h ;; vector function
pop ds
pop bx
pop ax
pop bp
ret
restvect ENDP
END
##
--- DB B1073/071082
* Origin: RadioLink! Columbus, OH (614)766-2162 HST/DS (1:226/140)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET