小编wae*_*raf的帖子

有没有一种方法可以在不传递参数的情况下调用函数?

我是信息安全方面的新手,我试图自学如何使用 python 构建一个简单的键盘记录器,我在一个网站中找到了这段代码:

import pythoncom, pyHook

def OnKeyboardEvent(event):
    print 'MessageName:',event.MessageName
    print 'Message:',event.Message
    print 'Time:',event.Time
    print 'Window:',event.Window
    print 'WindowName:',event.WindowName
    print 'Ascii:', event.Ascii, chr(event.Ascii)
    print 'Key:', event.Key
    print 'KeyID:', event.KeyID
    print 'ScanCode:', event.ScanCode
    print 'Extended:', event.Extended
    print 'Injected:', event.Injected
    print 'Alt', event.Alt
    print 'Transition', event.Transition
    print '---'

    # return True to pass the event to other handlers
    return True

# create a hook manager
hm = pyHook.HookManager()
# watch for all mouse events
hm.KeyDown = OnKeyboardEvent
# set the hook
hm.HookKeyboard()
# …
Run Code Online (Sandbox Code Playgroud)

python security function

4
推荐指数
1
解决办法
3875
查看次数

标签 统计

function ×1

python ×1

security ×1