• Welcome to Valhalla Legends Archive.
 

Simple VB Keylogger

Started by haZe, February 19, 2003, 02:07 PM

Previous topic - Next topic

haZe

How would I write a simple VB keylogger? I was thinking maybe on text1_keypress..but I can't figure out how to send all the keys pressed to my program. A little help please?

Banana fanna fo fanna

#1
Have fun hooking the windows API in VB.

Not too hard to do from C...I've done it a million times.

haZe

#2
..? explain deeper please

iago

#3
you have to use a system hook, look up SetHookEx or SetWindowsHookEx or something like that
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


haZe

#4
OK I got it

Public Declare Function SetWindowsHook Lib "user32" Alias "SetWindowsHookA" (ByVal nFilterType As Long, ByVal pfnFilterProc As Long) As Long
Now...How would I use that =/

Skywing

#5
QuoteOK I got it

Public Declare Function SetWindowsHook Lib "user32" Alias "SetWindowsHookA" (ByVal nFilterType As Long, ByVal pfnFilterProc As Long) As Long
Now...How would I use that =/
I'd suggest you look it up on MSDN Online.

Etheran

#6
Or the win32 help file will explain everything (there's a whole section in there about hooks).

haZe

#7
Nevermind, I found a very nice example on pscode.com, but thx ne ways

n00blar

Hmm i noticed a nice little api function called 'GetAsyncKeyState' and i have code to make it work just as good if not better than a hook. you may also try a few of these other API functions (search msdn)

GetKeyboardState, SetKeyboardState
GetKeyState

haZe

#9
ya thats what the thing on pscodE used.