Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keystroke.log gets created but doesnt record anything #3

Open
moulie415 opened this issue Jul 8, 2015 · 3 comments
Open

keystroke.log gets created but doesnt record anything #3

moulie415 opened this issue Jul 8, 2015 · 3 comments

Comments

@moulie415
Copy link

When i run the program keystroke.log gets created but it isnt recording anything, can u help?

@williamfiset
Copy link

Having the same issue here

@jonathanlurie
Copy link

Hi,
The same for me but it's not really important because the code can be changed. For instance, if you comment L49:

// fprintf(logFile, "%s %s\n", fmtTime, keyCodeToReadableString(keyCode));

and replace simply by a console output:

printf("%s %s\n", fmtTime, keyCodeToReadableString(keyCode));

Then, it works like a charm when launched with sudo. Though, since my keyboard layout is not QWERTY (I am French, we have AZERTY and it sucks) it responds like if I had a US keyboard. Doesn't really matter, just have to tweak the keyCodeToReadableString() function.

@cytodev
Copy link

cytodev commented Feb 22, 2017

@moulie415, @williamfiset, @jonathanlurie, and whom it may concern.

In order to write to the log file without terminating the execution you need to close the file handle with fclose or flush the buffer with fflush. Otherwise the entire buffer is not saved to the file while the program is running. It depends on where the buffer is kept, but it either writes on successful termination or gets deleted instead. See this SO answer for reference.

To get an idea of how you would go about flushing see these lines in caseyscarborough's keylogger.

Sorry for bumping a corpse.

CC: @dannvix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants