Win32 globalhook keylogger, why are the number keys not consecutive?

  • Thread starter Thread starter NotASmurf
  • Start date Start date
AI Thread Summary
The discussion centers on the use of a global hook for keyboard key capture, specifically regarding the discrepancy between expected ASCII values for keys 1-9 (48-57) and the actual logged values (480-568). Participants clarify that the logged values are likely not ASCII codes but rather keyboard scan codes, which differ from ASCII values. The mention of uppercase notation for lowercase characters and unexpected values for shift keys (160 and 161) further emphasizes the distinction between scan codes and ASCII. The conversation highlights the importance of understanding these differences when capturing key inputs.
NotASmurf
Messages
150
Reaction score
2
I'm using a globalhook into the keyboard for key capture, if I look up the ascii values for the keys 1-9, I see 48-57.
Now the actual logger shows

480
491
502
513
524
535
546
557
568

Sure, maybe it's ascii, maybe its because they're not numpad keys, but regardless, why are the numbers not consecutive?

Any help appreciated.
 
Technology news on Phys.org
Are you sure you're printing them out right? Is it possible you're printing out the value concatenated with the array index or something?
 
nope, if I type a, it prints 65, so that's fine (although it's weird that it uses uppercase notation for lowercase charecters), although left and right shift are `160 and 161 respectively. When it should be 15 in ascii.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top