flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
revolution
You will have to replace the keyboard driver in the kernel.
And depending upon your Windows version you might need to have it signed for Windows to accept it. |
|||
![]() |
|
codeHacker101
You have been a big help in a previous question I asked, so am pleasantly surprised to see its you again.
Last edited by codeHacker101 on 08 Nov 2020, 22:33; edited 1 time in total |
|||
![]() |
|
codeHacker101
"replace the keyboard driver" sounds like a very permanent change. I was hoping for an exe that will make this happen when I double-click on it to run it and things would go back to normal when I close the program/terminate the process. It that possible?
|
|||
![]() |
|
revolution
Not possible from user mode.
That would break the security of Windows and allow anyone to log keystrokes. |
|||
![]() |
|
codeHacker101
I intend to run the program as admin
|
|||
![]() |
|
revolution
Admin is still user mode.
You need to do this from the kernel. |
|||
![]() |
|
codeHacker101
Do I have to create my own driver or something?
|
|||
![]() |
|
codeHacker101
Sounds pretty impossible for a uni student who started assembly a few weeks ago.
|
|||
![]() |
|
revolution
codeHacker101 wrote: Do I have to create my own driver or something? codeHacker101 wrote: Sounds pretty impossible for a uni student who started assembly a few weeks ago. |
|||
![]() |
|
revolution
Or use a different OS.
DOS would make this trivial. |
|||
![]() |
|
codeHacker101
You said "kernal" and I found this https://www.educative.io/edpresso/what-is-windows-kernel. Don't even know what DOS is. Maybe I can disable a key, still detect it somehow and programatically send a different keypress. I think you can send keypress in C++. Maybe also assembly.
|
|||
![]() |
|
revolution
You can't use a user-mode program to override any kernel driver.
You can send fake keypresses to other applications. But that isn't what you described in the first post. It would just add more keys into the queue of the application. |
|||
![]() |
|
codeHacker101
So I may be able to
1) disable both keys 2) still somehow detect when either gets pressed 3) enable temperarily, send keystroke, disable again Sort of like pseudo replacement instead of real. What do you think? |
|||
![]() |
|
codeHacker101
Are 1 and 2 possible in user mode?
|
|||
![]() |
|
codeHacker101
Its after 4am here right now and I don't want to take too much of your time either because an ameture like me can turn this into an endless debate and still get nowhere.
But when you said "kernal" it helped me because I googled "windows kernal" and it increased me in knowledge. Maybe thats the best I can do right now. GOOGLE different relevant terminologies to help figure out a way forward. So if you are willing please tell me more such words and phrases so I can start learning. If not, thank you a lot for bothering to respond to my silly question anyways. |
|||
![]() |
|
revolution
From user mode you can't disable keystrokes in the kernel driver.
You can't prevent the driver from doing its job unless you have your own kernel driver. The only thing you can do from user mode is wait for the OS to tell you which keys are pressed. If another application has the focus then that app will get the keystrokes, not you, and you can't prevent that. |
|||
![]() |
|
Ali.Z
as rev said, you cannot switch/replace keycode unless you alter the device driver or implement yours.
so what you want to achieve isnt easily doable, and make no sense to swap to keys; 1. no you cant 2. yes 3. im not sure what do you mean as for 2, you can attach to thread input as every virtual thread have its own input queue/stack (regardless of the subsystem) but to be more subsystem specific, i.e. gui subsystem then you can make a small dll and inject it into foreground window, the windows who have current focus and hook their window procedure and specifically listen to keydown messages. _________________ Asm For Wise Humans |
|||
![]() |
|
codeHacker101
Sorry I wasted both of your time @revolution and @Ali.Z. This is clearly not doable in a way I was thinking. I was getting far ahead of myself. I have added [Closed] to the title (had to make it shorter because of the word limit). Thank you both for your assistance.
|
|||
![]() |
|
Grom PE
To swap keys around, you don't even need a running program, all you need is a custom keyboard layout.
For more complicated keyboard manipulation, might want to look into WH_KEYBOARD_LL. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.