Skip to content

keystroke.log gets created but doesnt record anything #3

Description

@moulie415

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

Activity

  1. williamfiset commented on Aug 19, 2015

    @williamfiset

    Having the same issue here

  2. jonathanlurie commented on Mar 5, 2016

    @jonathanlurie

    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.

  3. cytodev commented on Feb 22, 2017

    @cytodev

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions