Category : System Diagnostics for your computer
Archive   : PASSWRD4.ZIP
Filename : LOCK.ASM

 
Output of file : LOCK.ASM contained in archive : PASSWRD4.ZIP
PAGE 60,132
TITLE LOCK V1.2 - RECALLS PASSWORD DEVICE DRIVER CODE

;-----------------------------------------------------------------------
; LOCK V1.2
;
; LOCK IS DESIGNED TO WORK IN CONJUNCTION WITH PASSWRD4.SYS.
; ITS PURPOSE IT TO CALL A PORTION OF CODE INTERNAL TO THE
; DEVICE DRIVER PASSWRD4.SYS. THIS WILL ENABLE A USER TO "LOCK"
; THE PC UNTIL A USER REPLIES WITH THE CORRECT PASSWORD.
; ** CAUTION BEWARE OF UPPER CASE VS LOWER CASE WHEN RESPONDING **
;
; THIS CODE WILL CHECK THE INTERUPT VECTOR 66h FOR A NON ZERO SEGMENT
; REFERENCE BEFORE CALLING THE PASSWORD ROUTINE. PASSWRD4.SYS WILL
; INITIALIZE THIS INTERUPT A BOOT TIME. SINCE THE PASSWRD4.SYS
; DEVICE DRIVER, LIKE ANY DEVICE DRIVER, REMAINS RESIDENT THE USER
; IS ASSURED THAT HE ONLY NEED CHANGE PASSWRD4.SYS IN ORDER TO
; CHANGE THE SYSTEM PASSWRD.
;
; JOHN R. PETROCELLI
; 02/25/85
; REV 04/30/85
;
;----------------------------------------------------------------------
;
INT_VECTORS SEGMENT AT 0H ; POINT TO INTERUPT VECTOR TABLE
ORG 66H*4 ; INT 66H
ASK_OFF DW ; OFFSET OF PASSWORD RECALL
ASK_SEG DW ; SEGMENT OF PASSWORD RECALL
INT_VECTORS ENDS

CODE_SEG SEGMENT PARA 'CODE'

ASSUME CS:CODE_SEG, DS:CODE_SEG, ES:INT_VECTORS, SS:NOTHING

ORG 100H ; NEEDED FOR A .COM PROGRAM

BEGIN:
PUSH DS ; SAVE REGISTERS FOR
PUSH ES ; GOOD HOUSKEEPING (NO PUN
PUSH AX ; INTENDED)
PUSH BX ;
PUSH DX ;

MOV AX,0 ; SET ES TO REFERENCE
MOV ES,AX ; INT_VECTORS

MOV AX,CS ; SET DS TO REFERENCE
MOV DS,AX ; CODE_SEG

;=======================================================================
; THE FOLLOWINT 8 LINES RESET INT 09h TO POINT TO A PORTION OF THIS
; CODE(SEE BELOW) IN ORDER TO ELIMINATE CTRL STYLE KEYSTROKES
;=======================================================================
CLI ; INTERUPTS OFF
MOV AX,WORD PTR ES:[09h*4] ; INT 09h OFFSET INTO AX
MOV KBINT_OFF,AX ; SAVE IT FOR RECALL
MOV AX,WORD PTR ES:[09h*4+2] ; INT 09h SEG INTO AX
MOV KBINT_SEG,AX ; SAVE IT FOR RECALL
MOV WORD PTR ES:[09h*4],OFFSET CTL_ENTRY ; NEW INT 09h OFFSET
MOV WORD PTR ES:[09h*4+2],CS ; NEW INT 09h SEG
STI ; INTERUPTS ON
;=======================================================================

LEA BX,ASK_OFF ; SET ES:BX TO POINT TO
; LOCATION IN THE INT VECTOR
; TABLE CONTAINING SEG & OFFSET
; OF PASSWORD RECALL ROUTINE

MOV AX,ES:[BX+2] ; LOAD AX WITH SEGMENT OF CALL
CMP AX,0 ; AND IF THE SEGMENT IS 0 THEN
JZ ERROR_EXIT ; EXIT - NOT INITIALIZED

CALL DWORD PTR ES:[BX] ; CALL PWORD IF INSTALLED
; ES:BX WILL POINT TO THE ADDRESS
; OF THE ROUTINE TO BE CALLED

EXIT:
;=======================================================================
; THE FOLLOWING 8 LINES RESET INT 09h TO ITS ORIGINAL SEGMENT AND OFFSET
; AS IT WAS UPON ENTRY TO THIS ROUTINE
;=======================================================================
CLI ; INTERUPTS OFF
MOV AX,0 ; LOAD AX WITH SEGMENT OF INTERUPTS
MOV ES,AX ; AND MAKE ES POINT TO IT
MOV AX,KBINT_OFF ; LOAD AX WITH ORIGINAL INT 09h OFFS
MOV WORD PTR ES:[09h*4],AX ; RESTORE ORIGINAL INT 09h OFFSET
MOV AX,KBINT_SEG ; LOAD AX WITH ORIGINAL INT 09h SEG
MOV WORD PTR ES:[09h*4+2],AX ; RESTORE ORIGINAL INT 09h SEG
STI ; INTERUPTS ON
;=======================================================================

POP DX ; RESTORE REGISTERS FOR
POP BX ; GOOD HOUSKEEPING (NO PUN
POP AX ; INTENDED)
POP ES ;
POP DS ;

RET ; RETURN TO DOS

ERROR_EXIT: ; SEGMENT AND/OR OFFSET
; WERE 0000 SO WE DON'T CALL
; JUST PRINT ERROR MESSAGE

MOV DX,OFFSET NO_INIT ; DS:DX POINTS TO ERROR MSG
MOV AX,0900H ; SET UP AX TO PRINT DS:DX
INT 21H ; PRINT ERROR MSG

JMP EXIT ; RETURN TO DOS

NOP ; PAD
NOP ; PAD
NOP ; PAD

CTL_ENTRY:
NOP
STI ; RESET INTERRUPTS
PUSH DS ; SAVE SYSTEM(OTHERWISE IT MAY
PUSH ES ; BECOME AN ENDANGERED SPECIES!)
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH SI
PUSH DI
PUSH BP

MOV SI,CS ; GET SEGMENT VALUE
MOV DS,SI ; INTO DATA SEGMENT
MOV ES,SI ; AND EXTRA

IN AL,060H ; READ KEYBOARD INPUT

TEST AL,080H ; SEE IF KEY RELEASE
JNZ CTL_EXIT ; YES, IGNORE RELEASES

CMP AL,01DH ; SEE IF CTRL KEY DEPRESSED
JNZ CTL_EXIT ; NO, GO TO NORMAL HANDLING

; KEY WE WANT, RESET KEYBOARD
; PORT TO ACKNOWLEDGE RECEIPT
; OF KEYSTROKE INFO

IN AL,061H ; READ 8255 PORT
OR AL,080H ; SET ACKNOWLEDGE SIGNAL BIT
OUT 061H,AL ; SEND ACKNOWLEDGE TO PORT
AND AL,07FH ; RESET ACKNOWLEDGE BIT
OUT 061H,AL ; RESTORE ORIGINAL 8255 PORT STATUS

MOV AL,020H ; SEND EOI TO 8259 COMMAND REG
OUT 020H,AL

POP BP
POP DI ; RESTORE
POP SI
POP DX
POP CX
POP BX
POP AX
POP ES
POP DS
IRET ; RETURN FROM INTERRUPT

CTL_EXIT: ; HANDLE KEYSTROKE NORMALLY,
POP BP ; JUMP TO REGULAR KEYBOARD HANDLER
POP DI
POP SI ; RESTORE REGISTERS
POP DX
POP CX
POP BX
POP AX ; JUMP TO REGULAR KEYBOARD ROUTINE
POP ES
POP DS
;
DB 0EAH ; THIS PRODUCES FAR JUMP TO BELOW
;
KBINT_OFF DW 0 ; STORE OLD KEYBOARD INT ADDRESS
KBINT_SEG DW 0


NO_INIT DB 1BH,'[5m', ; MAKE "PASSWORD" BLINK
DB ' PASSWORD '
DB 1BH,'[0m' ; ATTRIBUTES TO NORMAL
DB ' Device Driver Does Not'
DB ' Appear To Be Installed'
DB 07H,0DH,0AH,'$' ; BEEP+CR+LF


CODE_SEG ENDS

END BEGIN


  3 Responses to “Category : System Diagnostics for your computer
Archive   : PASSWRD4.ZIP
Filename : LOCK.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/