keyboard hook

Programming, for all ages and all languages.
Post Reply
Schubi

keyboard hook

Post by Schubi »

Hi!
I need a program which is able to read any scancode from a keyboard. (Win98)
The problem: I'll have to read ANY scancode, even scancodes that are not known by Windows.
But: Windows changes all not known scancodes into any other.
If I read direktly from the keyboard port (asm) so I'll get the allready changed codes.

So I need a keyboad hook that can read ALL scancodes (0..255)

Can anybody help me?

Greets, Schubi
Ozguxxx

Re:keyboard hook

Post by Ozguxxx »

Hi I think this cide can be used to do very malicious attack as keylogger, in fact I have implemented a win32 program that used both hooking and nonhooking for keylogging but I never used it for malicious attack, anyway... This OS work had took me away from win32 for about half a year and I cannot remember it exactly. But its very very easy... (as far as I remember)
Tim

Re:keyboard hook

Post by Tim »

Schubi wrote:So I need a keyboad hook that can read ALL scancodes (0..255)
You can't do this unless you put a hook above the keyboard driver. Although scan codes are available to Win32 (and therefore to keyboard hooks), you'll only find out about a key if the keyboard driver recognises it.

What key do you want to look for? Assuming the keyboard driver is correct, there won't be any scan codes that Windows doesn't recognise.
Schubi

Re:keyboard hook

Post by Schubi »

I have to write a software which could test all keyboards
including customer specific. I have a sample here with 128 Keys with 2 states, so it can send all 256 make and break codes.
but windows just let this scancodes pass the driver which have a funktion on a default 102/105 keyboard.
thats the reason why all multimedia keyboards need a several driver to can be run.would windows let pass the codes you just need a simple program to operate these keys.
well, very simple, may be. but how can I solve the problem?
my programming skills are just fine i think, but with dlls and drivers I have absolutely none experience...

please help me, and excuse my bad english ;-)
Tim

Re:keyboard hook

Post by Tim »

As I said, "You can't do this unless you put a hook above the keyboard driver". It is up to the keyboard driver to pass key presses down to the GUI; if the keyboard driver doesn't recognise a key then it doesn't get noticed.

You might have some luck from the Windows Driver Development Kit (http://www.microsoft.com/ddk/).
Schubi

Re:keyboard hook

Post by Schubi »

thats the next problem.
I have no ms visual c++ and i cant use it at work.
I work with borland delphi / c++ builder.
I would need a ddk for borland products.
Can you tell me if such a packet exists?
Tim

Re:keyboard hook

Post by Tim »

I doubt it. The only DDK distribution I know of is the Microsoft one.

In short: you're on your own.
Post Reply