-
Notifications
You must be signed in to change notification settings - Fork 0
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
Keylogger tools #37
Merged
Merged
Keylogger tools #37
Conversation
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
Using `pio device monitor | grep -E -o --line-buffered "(^[0-9]+:)" | ../../../Software/tools/keylogging/logging.sh | tee -a comparing-timing.log` in the `Hardware/Firmware/mainboard` directory this script helps with collecting the microseocond timestamps of the motherboard alongside the output of `date +%s%N`.
Set of value pairs the timestamp on the host computer being collected as each line comes in on the serial monitor. There is also a simple evaluation script that prints the mean and then standard deviation of the microseconds, which is less than 1ms.
Collect the filtered output from the QMK driven keyboard using `./hid_listen | grep -E --line-buffered "(0x[A-F0-9]+,)?[0-9]+,[0-9]+,[0-9]{1,2}"` and adds the timestamp given by `date +s%N`. This script required the program hid_listen to be executable in the same folder and then continuously appends to keylog.csv
The aim is to translate the keylogger's output into the same format of the virutal keyboard. This is a first framework with the translation and output function missing.
This is simple implementation with the proposed interface from #39. The implementation is quite simple and the window is fragile as it only draws every time when it receives an input. But it should suffice for our purposes.
We have to add proper documentation on how to set this and the usage. The readme should also include the results of the comparison between PC and μC timestamps. |
Indented optional steps in QMK firmware mods
The former method of representing a key position was a string with the character representation of the column and row position. This is neither extensible nor is it a very clean way to represent the position. Thus, we changed the representation to a 2-tuple (column, row). Additionally, we changed the column and row values to match those that qmk uses internally.
Make the processes more elaborate and up to date (i think).
- fixed functions to act on single record instead of a list - print timestamp
Python evaluates `bool("0")` und `bool("1")` zu `True`. Gewünscht ist jedoch `bool("0") == False`, dies erhalten wir mit `bool(int("0"))`.
Calling the `keylogger-for-data-collection.sh` script from another directory will result in an error because the local hid_listen script will not be in that directory. Referring to the hid_listen script from the keylogger script location (dirname "$0") solves this issue. Further checking for a global hid_listen script makes things easier with a nix-shell environment.
Datasets won't be part of the public repository anymore.
Keylogger conversion tools are ready functionality wise. Further changes should be included in the upcoming refactoring. |
palisn
approved these changes
Mar 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contains a keylogging script and some additional tools.
The conversion script to convert the timestamped keylogging data to the same format delivered by the virtual keyboard. This could utilize a selector to only consider the left or right hand and then provide uniform output, mirrored for the right hand.
Will finish and close #30.