Monday, August 6, 2018

One version of kbhit() using windows API


Here is one version of kbhit() using windows API (GetAsyncKeyState). It runs through 255 possible key scancodes in pulses. If a key is pressed, it returns 1 and the value of the key pressed by reference.
This can be used to make a rudimentary keylogger in Windows.
Proof of concept:  Keylogger Source code

#include <windows.h>
Prototype: int kbhit(char *ch); 
Call:
int keypressed=0;
char ch=0;

keypressed = kbhit(&ch);







No comments:

Post a Comment