RE: [VB.Net] Make a Inbuilt keylogger 05-01-2012, 09:20 AM
#11
(07-26-2011, 11:13 PM)blowdoof Wrote:(01-19-2011, 09:56 PM)The 7th Sage Wrote: yea, i'll post one later.
if you won't, i will :-)
note - to avoid abuse, i'll only post the essential...haha..
Code:Private KeyboardHookProcedure As Win32.HookProc Public Sub InstallHooks() If hKeyboardHook = 0 Then ' install Keyboard hook KeyboardHookProcedure = New Win32.HookProc(AddressOf KeyboardHookProc) hKeyboardHook = Win32.SetWindowsHookEx( _ Win32.WH.WH_KEYBOARD_LL, _ KeyboardHookProcedure, _ Marshal.GetHINSTANCE(Reflection.Assembly.GetExecutingAssembly().GetModules()(0)), _ 0) If (hKeyboardHook = 0) Then 'SetWindowsHookEx failed RemoveHooks() Throw New Exception("SetWindowsHookEx failed.") End If End If End Sub Public Sub RemoveHooks() Dim keyboardResult As Boolean = True If hKeyboardHook <> 0 Then keyboardResult = Win32.UnhookWindowsHookEx(hKeyboardHook) hKeyboardHook = 0 End If If Not keyboardResult Then 'UnhookWindowsHookEx failed Throw New Exception("UnhookWindowsHookEx failed.") End If End Sub
You just copied that from someplace which is obvious because you didn't include the definition of HookProc along with several other API's that this would need. As well it also doesn't look like a really optimized method anyways. It's not really the essentials anyways, the essential part is overriding WndProc.
Edit: It wouldn't be abuse anyways since it's available basically everywhere, but not many actually understand Windows Messages and how they are interpreted.
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)



). Because i write lots of financial apps and other similar stuff, i tend to reuse as much as possible where i can (but only those parts that have been optimized. And i must since i'm self-employed, time=money, etc...). Have to admit that i do it more often in web languages then .net for example. ![[Image: Insane.png]](http://i193.photobucket.com/albums/z268/enanobp/Photoshop/Insane.png)