diff options
Diffstat (limited to 'md/writeup/linux_keyboard_led.md')
-rw-r--r-- | md/writeup/linux_keyboard_led.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/md/writeup/linux_keyboard_led.md b/md/writeup/linux_keyboard_led.md new file mode 100644 index 0000000..7217244 --- /dev/null +++ b/md/writeup/linux_keyboard_led.md @@ -0,0 +1,43 @@ +title: Linux keyboard LED +keywords: linux,keyboard,led + +# Linux keyboard LED +Send some bytes and flash LED on you keyboards.Run it under root. +There will no be any errors if something happens. + +Usage: +``` +./kbled [NumLock] [CapsLock] [ScrLock] +``` +``` +./kbled 0 0 0 +``` + +```c +#include <stdlib.h> +#include <fcntl.h> +#include <sys/syscall.h> +#include <linux/kd.h> + +int main( int argc , char **argv ) +{ + int rc,i; + if (argc != 4) exit(0); + + rc = syscall(SYS_open,"/dev/console",O_WRONLY,7*64+7*8+7); //open cosole + if (rc == 0) rc = 1; + + i = (argv[1][0]-'0')*2+(argv[2][0]-'0')*4+(argv[3][0]-'0'); + ioctl( rc , KDSETLED , i ); + + return 0; +} +``` + + + + +## Downloads +kbled.tar.gz - +1KiB - http://archive.main.lv/files/writeup/linux_keyboard_led/kbled.tar.gz + |