News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to lock keyboard with assembly?

Started by byrusber, January 20, 2009, 01:30:55 PM

Previous topic - Next topic

byrusber

How can i lock the keyboard with assembly?

ttaylor

That's easy, get yourself some kitchen shears... Approach the pc.... find the keyboard cable... *SNIP* LOL j/k I'll bet that you cant lock the keyboard but I know you can steal it. Through API. Why might one choose to lock the keyboard? How would you unlock a locked keyboard? I usually just do "SendKeys" API with the windows key + keyboard letter "L"

Mark Jones

PC's, at one time, included a physical key-lock to disable the keyboard, usually a minature barrel-type key. Many mainboards may still provide a "legacy" keylock header for this purpose, where a switch may be connected to render it temporarily inoperable.

Also, a few BIOSes may provide both a "supervisor" and "user" password schema, where the "supervisor" password is needed to modify the BIOS settings, and a "user" password is required to boot the system.

Today, simply press "Ctrl-Alt-Del" in Windows and choose "Lock Workstation" or similar, and presto, the keyboard is pretty darn useless. That works even better than a keyboard-only lock...

But all of these require an enabling action by the user, as it should be. What plausable reason can you give for locking out the user -- without his consent?

I sense this thread quickly heading to the trash heap.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

BlackVortex

"lock the keyboard with assembly"  !!!


obvious lamer is obvious

Vortex

The LockWorkStation API locks the computer :


.386
.model flat,stdcall
option casemap:none

include     \masm32\include\kernel32.inc
include     \masm32\include\user32.inc

includelib  \masm32\lib\kernel32.lib
includelib  \masm32\lib\user32.lib

.code

start:

    invoke  LockWorkStation
    invoke  ExitProcess,0

END start


byrusber

i mean something like that:



if you write
-o 64,AD
and press enter in debug, the keyboard is locked in the debug window.

how can i do this in assembly?

redskull

mov al, 0ADh
out 64h, al


just make sure you link it as a real mode app
Strange women, lying in ponds, distributing swords, is no basis for a system of government

vanjast

Couldn't one hook the Keyboard and terminate the keyboard (keypress) message sequence in the hook ?

Just guessing here as I haven't tried this..
:bg

redskull

I always thought the SAS generated a interrupt; no matter how much you fuss around with hooks and messages, pressing ctrl-alt-del will always bring up the task manager, right?

-ac
Strange women, lying in ponds, distributing swords, is no basis for a system of government