home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PARADIS1
/
PASSWORD.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-02-03
|
3KB
|
114 lines
(3362) Fri 31 Jan 92 20:08
By: Max Maischein
To: Don Waybright
Re: Help wanted....
St:
---------------------------------------------------------------------------
@MSGID: 2:249/6.17 0f12cff5
@REPLY: 1:264/177 0d95153d
@PID: FM 2.02
> 1) How can I disable the user's ability to stop a program's
> running with a CTRL Break?
Lookup CheckBreak in your manual(s) or press CTRL-F1 on it.
> 2) Disable the keybaord. Like if an incorrect passwrod is
> entered the keyboard locks out.
Let the master speak for himself :
(4375) Fri 10 Jan 92 18:42
By: Trevor Carlsen
To: Johannes Beekhuizen
Re: Re: Locking the Keyboard
St:
------------------------------------------------------------------------
@EID:0db9 182a955d
@TCID:3e7fabe8 495d
JB> Does anyone know if/how it's possible to disable the
JB> keyboard from within a Pascal or Assembler program?
Int $09 is the hardware interrupt for the keyboard. Here is a program that
will disable the keyboard until a 4 character password is entered.
{$X+}
{ Author Trevor J Carlsen. Released into the public domain. Req TP6 }
{ Compile and run this program and all keyboard input except keys that }
{ make up a valid password will be ignored. In this case the password }
{ is '1234' and the scancodes for those keys are stored in a constant. }
{ To change the password compute the scancodes for the desired password}
{ and change the password approriately. }
uses
Dos,
Crt;
var
OldInt9 : pointer; { for storing the old interrupt vector }
password : string[4];
pwdlen : byte absolute password;
procedure RestoreOldInt9;
{ Restores control to the old interrupt handler }
begin
SetIntVec($09,OldInt9);
end;
{$F+}
procedure NewInt9; interrupt;
const
masterpwd :string[4] = #2#3#4#5; { '1234' scancodes }
var
scancode : byte;
procedure ResetKBD;
var
b : byte;
begin
b := port[$61];
port[$61] := b or $80;
port[$61] := b;
port[$20] := $20; { Signals EOI to PIC }
end;
begin
scancode := port[$60];
if chr(scancode) = masterpwd[pwdlen+1] then begin
password[pwdlen+1] := chr(scancode);
inc(pwdlen);
if password = masterpwd then
RestoreOldInt9;
end
else if not odd(scancode shr 7) then { invalid key }
pwdlen := 0;
ResetKBD;
end;
{$F-}
begin
pwdlen := 0;
GetIntVec($09,OldInt9);
SetIntVec($09,@NewInt9);
ReadKey;
end.
TeeCee
> 3) How can I make it so that a computer will not boot from floppy
> drives?
No. If the computer has an QUAD-TEL BIOS, there is some way, but there is no
way for software to intercept the BIOS before DOS has booted ( at least for
TP-programs :-) )
M;
---
* Origin: SUX released on PDN !! THE standart collection (2:249/6.17)
@PATH: 249/6 1 2 243/47 13/13 396/1 170/400 512/0 1007