Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
2.67/5 (3 votes)
See more:
Im trying to understand the process of hooking. Now I have found a piece of code which was from a key logger found on A1VBCode an open source site for educational purposes, and keep in mind I have no concern for malicious activity but I noticed this guy is using hooks to hook the keys on the keyboard. These are a few of his hooks:
K_Return = &HD
K_Backspace = &H8
K_Space = &H20
K_Tab = &H9
K_Esc = &H1B
K_Control = &H11
K_LControl = &HA2
K_RControl = &HA3
K_Delete = &H2E
K_End = &H23
K_Home = &H24
K_Insert = &H2D


These hook codes aren't found on any tables I have tried searching for, like ASCII tables I dont even know if im looking in the right area. I also noticed from the code project here: API hooking revealed[^] where they explain it. What is the purpose of hooking and where can I find codes that represent each key on a board or for the mouse clicks etc?
Posted

1 solution

According to this ASCII chart[^] (and all others, so far as I know):

The decimal value for the keycode of the Return key is 13, or in hexadecimal D (&HD)
The decimal value for the keycode of the Backspace key is 8, or in hexadecimal 8 (&H8)
The decimal value for the keycode of the Space key is 32, or in hexadecimal 20 (&H20)

Need I continue?
 
Share this answer
 
v2
Comments
Herboren 11-Apr-11 18:57pm    
So the hex value is used, I just figured it was a custom var created by the user, mmkay I see now.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900