4
votes

I just bought a new keyboard, and I'm interested in tracking exactly how many keypresses/strokes I make during the entire life of the keyboard. (I would want to just record keyUp, as I don't care about repeats)

I've been googling around for the best way to do this, but I don't even know what approach to take, so I'm having trouble searching intelligently. Also, the only language I've really worked with is C#. Haven't done anything with C/C++ or WinAPI

Is it difficult to modify the Win 7 drivers directly? I do want to be able to record keystrokes from the moment the computer boots, but this may not be easily done. I would prefer to use an existing driver or hook, as I really don't care to get into learning device drivers right now.

I've looked briefly at Ctrl2Cap, but I don't know how to modify something like that to suit my case.

Other questions I looked at,

This one indicates writing a USB Filter driver may work, but I have no clue where to start on that. Disabling the keyboard in windows c++?

3

3 Answers

1
votes

It is not necessary to go the driver route, which is not for the faint of heart. You can use use a low level keyboard hook which will work fine from .NET.

I did a quick bing and found the following on codeplex http://globalmousekeyhook.codeplex.com/

It should get you going

1
votes

If you want to do that you need to use Kernel Level Keylogger. It's grabs the keystrokes before the operating system takes effects and this one 99% invisible for detection techniques. Then you can grab the Windows Log On screen typed things like password/username etc.

@ChrisTaylor's key logger not work for WinLog-on Screen I reckon. If you can install the keyboard driver filter before the system keyboard device driver take a action you can handle windows user login screen also. But In order to install this driver level key hook you need to have administrator privileges.

I found Unix and Windows Keyloggers from Github. Free to play with this https://www.adlice.com/kernelmode-rootkits-part-3-kernel-filters/ and have fun!

-1
votes

That, what you want is dangerous! With the same code everyone can create keylogger* But if you not a virus creator then I recommend you to search "hotkeying in C/C++" or something like that and hook keyboard with hotkeys! I have written HotKey Maker in VB6 which can make hotkey from every button of keyboard. But I really not interested in viruses :) Good Luck !

*Virus which hooks your keyboard and send all what you wrote in keyboard to Virus owner