Category : System Diagnostics for your computer
Archive   : SYSLOCK.ZIP
Filename : RELOCK.ASM

 
Output of file : RELOCK.ASM contained in archive : SYSLOCK.ZIP
PAGE 61,132 ; (Ctrl-O) <--- Insert ASCII 15 for Condensed Print
TITLE RELOCK.ASM (Creates RELOCK.COM)
; Version 1.01, 7/10/85
; All Rights Reserved: J. C. Kilday Associates, Peaks Island, ME 04108

; RELOCK.COM is a companion program which interfaces with the device driver,
; SYSLOCK.SYS. It allows the user to disable any further use of the PC until
; the system password is entered. Ctrl-Break, Ctrl-Alt-Del, and any other
; function involving use of the Ctrl key are disabled. Type RELOCK
; to secure the PC.

; Since SYSLOCK.SYS is set up as a dummy read-only character device, RELOCK.COM
; accesses the device driver by issuing a device open and dummy device read
; command to re-activate the portion of the driver which requests entry of the
; system password. If the correct password is entered, the device driver
; returns control to DOS after telling it a lie, i.e., that the correct number
; input characters were transferred to the requesting application. Falling
; for this bit of fiction, DOS transfers control back to the requesting
; application, RELOCK.COM. After restoring full keyboard capability this
; program invokes a normal exit and the DOS prompt appears.

CSEG SEGMENT PARA 'CODE'
ASSUME CS:CSEG, DS:CSEG

ORG 100H

BEGIN: JMP SHORT START



DEV_NAME DB 'SLCK',0 ;ASCIIZ string: name of device driver
DUMMY_BUF DB ? ;Dummy buffer. Really not needed.

NOT_INST DB 'The SYSLOCK.SYS'
DB ' device driver is not'
DB ' installed.',7,13,10,'$';Msg terminated with CR,LF, & BEEP

START: MOV AX,0 ;Point ES to segment 0
MOV ES,AX
MOV AX,CS ;Point DS to this code segment
MOV DS,AX

; Change keyboard interrupt vector to point to local INT 09H handler

CLI ;Turn off interrupts
MOV AX,WORD PTR ES:[09H*4];Save offset part of INT 09H vector
MOV KBINT_OFF,AX
MOV AX,WORD PTR ES:[09H*4+2] ;Save segment part of INT 09H vector
MOV KBINT_SEG,AX
MOV WORD PTR ES:[09H*4],OFFSET KB_INT ;Insert new vector offset
MOV WORD PTR ES:[09H*4+2],CS ;Insert new vector segment
STI ;Turn interrupts back on

; Invoke the device driver, SYSLOCK.SYS, to ask for password

LEA DX,DEV_NAME ;Point DX to ASCIIZ string containing
; the device name
MOV AX,3D00H ;Open the device for input
INT 21H
JC ERROR_EXIT ;Test for failure of open request
MOV BX,AX ;Put file handle returned by the open
; into BX to set up for a read request
MOV CX,1 ;Request one character to be read
LEA DX,DUMMY_BUF ;Establish dummy buffer to catch char.
MOV AX,3F00H ;Read from device
INT 21H
; Note: Control will not return to this program until the device driver
; receives the correct password. When it does .....

; Restore keyboard interrupt vector and return to DOS

EXIT: CLI ;Turn interrupts off
MOV AX,0 ;Point ES to segment 0
MOV ES,AX
MOV AX,KBINT_OFF ;Restore offset portion of vector
MOV WORD PTR ES:[09H*4],AX
MOV AX,KBINT_SEG ;Restore segment portion of vector
MOV WORD PTR ES:[09H*4+2],AX
STI ;Turn interrupts back on
INT 20H ;Return to DOS

ERROR_EXIT:
LEA DX,NOT_INST ;Point DX to "Not Installed" message
MOV AH,9 ;Print the message
INT 21H
JMP EXIT ;Prepare to return to DOS

; New Keyboard Interrupt Handler

KB_INT:
STI ;Enable interrupts
PUSH DS ;Save registers to be used
PUSH AX
MOV AX,CS ;Establish addressability of data
MOV DS,AX
IN AL,60H ;Read keyboard input
TEST AL,80H ;Is it a key being released?
JNZ NML_KB_INT ;If yes, go to reg. KB int handler
CMP AL,1DH ;Is the Ctrl key pressed?
JNZ NML_KB_INT ;If no, go to reg. KB int handler
IN AL,61H ;Read 8255 Port PB
OR AL,80H ;Set KB acknowledge signal
OUT 61H,AL ;Send acknowledge
AND AL,7FH ;Reset KB acknowledge signal
OUT 61H,AL ;Restore original 8255 Port PB
MOV AL,20H ;Send End of Interrupt command to
OUT 20H,AL ; 8259 Int. Command Register
POP AX ;Restore registers
POP DS
IRET ;Return to point of interrupt

NML_KB_INT:
POP AX ;Restore registers in preparation
POP DS ; for going to normal KB int handler
DB 0EAH ;This is op code for a far jump to the
KBINT_OFF DW ? ; the normal KB interrupt handler at this
KBINT_SEG DW ? ; offset and segment.

CSEG ENDS
END BEGIN


  3 Responses to “Category : System Diagnostics for your computer
Archive   : SYSLOCK.ZIP
Filename : RELOCK.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/