From 0ab4ab1ef46d6696243ce5a57a4008eebfde1b20 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Fri, 28 May 2021 09:23:32 +0100 Subject: Update last articles --- md/writeup/linux_keyboard_led.md | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 md/writeup/linux_keyboard_led.md (limited to 'md/writeup/linux_keyboard_led.md') 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 +#include +#include +#include + +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 + -- cgit v1.2.3