Keylogger for anti theft app
I made an anti theft application for my laptop.
If i report it stolen online it'll log on to a website and the IP will be logged.
I want to add a keylogger to it so i can find out more easily who is in possession of my laptop.
When i use the GetAsyncKeystate
and the for i 32 to 128
if getasynckeystate(i) = -some number
then store chr(i)
my application just gets stuck.
Is there a better alternative for this?
Thanks
Re: Keylogger for anti theft app
I don't want an already made keylogger. I want to implement a keylogger in my own anti theft application. The logged keys will then be sent to my website. With this information i'll try to find out the identity of the thief.
Re: Keylogger for anti theft app
how do you use the code in your first post?
a loop?
Re: Keylogger for anti theft app
Yes.
Public Class frmMain
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
Private Sub tmrMain_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMain.Tick
For i As Integer = 1 To 128
If GetAsyncKeyState(i) = -32767 Then
Select Case i
Case 1
Log("[Left Click]")
Case 2
Log("[Right Click]")
etc...
End Select
End If
Next
End Sub
End Class
The thing is that if instead of Log i put Msgbox(Chr(i)) it works.
But if i put Textbox1.text = textbox1.text & Chr(i) or even TextBox1.text = Chr(i) it just doesn't work.
Re: Keylogger for anti theft app
Quote:
Originally Posted by Ruberducky
Yes.
Public Class frmMain
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
Private Sub tmrMain_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMain.Tick
For i As Integer = 1 To 128
If GetAsyncKeyState(i) = -32767 Then
Select Case i
Case 1
Log("[Left Click]")
Case 2
Log("[Right Click]")
etc...
End Select
End If
Next
End Sub
End Class
The thing is that if instead of Log i put Msgbox(Chr(i)) it works.
But if i put Textbox1.text = textbox1.text & Chr(i) or even TextBox1.text = Chr(i) it just doesn't work.
It works fine for me, what happens for you?
Re: Keylogger for anti theft app
Well, the thing is that it actually works as long as i do not try to write or append the logged key to a textbox or a variable or a label or something.
I can catch the key and then show a messagebox containing the key but as soon as i want to make a log of them in a textbox the loop stops working.
Re: Keylogger for anti theft app
What's the interval of the timer?
Re: Keylogger for anti theft app
I've tried 1, 10, 100, 500 and 1000. None work.
I've got no idea what it could be...
Btw i use Microsoft Visual Basic 2005 Professional.