WinRing0 - Send keys in Hardware-Level (update on 2017-01-18)

Post your working scripts, libraries and tools for AHK v1.1 and older
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: WinRing0 - Send keys in Hardware-Level

18 Aug 2016, 01:54

vasili111 wrote:What is the reason for sending keys from Ring 0 ? Not detected by games or any other reason?
When normal ways doesn't work.

For example this one, the activeX control PassGuardCtrl. You can't send keys to it using the normal ways.

Code: Select all

#NoEnv
#SingleInstance Force

RunAsAdmin()
RegDLL()

Gui, Add, ActiveX, w400 h40 Border vpwdCtrl, {3A2C8BC3-5B68-4AE5-81D6-6DC378708F3E}
	pwdCtrl.BackColor := 0xffffff
	pwdCtrl.ForeColor := 0x318722
	pwdCtrl.edittype := 1 ; 1=plain text, 2=password (default)
Gui, Show
Return

GuiClose:
	UnRegDLL()
ExitApp

RunAsAdmin() {
	If !A_IsAdmin {
		Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
		ExitApp
	}
}

RegDLL() {
	try {
		obj := ComObjCreate("{3A2C8BC3-5B68-4AE5-81D6-6DC378708F3E}")
	} catch e {
		if FileExist("PassGuardCtrl.dll")
			RunWait, regsvr32 /s PassGuardCtrl.dll
		else
			throw, "PassGuardCtrl.dll is missing."
	}
}

UnRegDLL() {
	RunWait, regsvr32 /s /u PassGuardCtrl.dll
}
Download: PassGuardCtrl.zip
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: WinRing0 - Send keys in Hardware-Level

20 Aug 2016, 13:50

But is it harder for games to detect with this method?
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
qwerqwer
Posts: 5
Joined: 16 Jan 2017, 12:22

Re: WinRing0 - Send keys in Hardware-Level

16 Jan 2017, 12:24

tmplinshi wrote:Your example code is working for me. Have you tried Run As Administrator? Otherwise I've no idea what the problem is.
I can't get this to work on Windows 10 x64.

Like the other report, nothing happens. I can see that everything is getting loaded without errors, the registry keys are created, but from what I can tell there's no service running? At least in the task manager. GetDllStatus shows 0 ("No error")

Any ideas? It does work inside a VM with Windows 7, just no on 10.
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: WinRing0 - Send keys in Hardware-Level

17 Jan 2017, 01:14

qwerqwer wrote:
tmplinshi wrote:Your example code is working for me. Have you tried Run As Administrator? Otherwise I've no idea what the problem is.
I can't get this to work on Windows 10 x64.

Like the other report, nothing happens. I can see that everything is getting loaded without errors, the registry keys are created, but from what I can tell there's no service running? At least in the task manager. GetDllStatus shows 0 ("No error")

Any ideas? It does work inside a VM with Windows 7, just no on 10.
Hi, try the new version v1.11.
v1.11 (2017-01-17) - Added an internal function Ensure_Admin_And_Compiled()
qwerqwer
Posts: 5
Joined: 16 Jan 2017, 12:22

Re: WinRing0 - Send keys in Hardware-Level

17 Jan 2017, 09:19

tmplinshi wrote:
qwerqwer wrote:
tmplinshi wrote:Your example code is working for me. Have you tried Run As Administrator? Otherwise I've no idea what the problem is.
I can't get this to work on Windows 10 x64.

Like the other report, nothing happens. I can see that everything is getting loaded without errors, the registry keys are created, but from what I can tell there's no service running? At least in the task manager. GetDllStatus shows 0 ("No error")

Any ideas? It does work inside a VM with Windows 7, just no on 10.
Hi, try the new version v1.11.
v1.11 (2017-01-17) - Added an internal function Ensure_Admin_And_Compiled()
Same problem, as I was already compiling the script and running it as administrator. I also tried running in compatibility mode. It's probably something with Windows 10 that changed, since it works in other versions of the same OS.
Thanks.
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-17)

17 Jan 2017, 09:54

@qwerqwer

I'm using Windows 10 64-bit, it works for me on AHK v1.1.24.04 (A32/U32/U64).
Try my precompiled exe WinRing0_test.zip, if it works for you then you did something wrong.

Please note that WinRing0 doesn't support USB keyboard.
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-17)

17 Jan 2017, 10:24

tmplinshi wrote:Please note that WinRing0 doesn't support USB keyboard.
Reading this is the first post also made me curious how to interpret that. So this means it requires a non-USB keyboard to be connected to the system in order to inject the data?
qwerqwer
Posts: 5
Joined: 16 Jan 2017, 12:22

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-17)

17 Jan 2017, 10:45

tmplinshi wrote:@qwerqwer

I'm using Windows 10 64-bit, it works for me on AHK v1.1.24.04 (A32/U32/U64).
Try my precompiled exe WinRing0_test.zip, if it works for you then you did something wrong.

Please note that WinRing0 doesn't support USB keyboard.
None of the executables works on W10, but it's ok inside my VM.

Maybe it's something with my PS2 keyboard. Is there a way to fake a virtual keyboard for winring0 to use? Like I had 2 connected PS2 keyboards (or even a USB + a fake PS2 only for this script to work).

Thanks again!
qwerqwer
Posts: 5
Joined: 16 Jan 2017, 12:22

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-17)

17 Jan 2017, 15:57

tmplinshi wrote:@qwerqwer Try another library DD --> https://autohotkey.com/boards/viewtopic.php?f=6&t=27007
Wow, you are quick. :clap:

I really appreciate the time you took to help. Thank you, I will try that library once I get home.
raskun
Posts: 13
Joined: 01 Mar 2017, 20:30

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-18)

05 Mar 2017, 06:05

Any idea how to make this work with F1-F12 keys?
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-18)

05 Mar 2017, 06:13

raskun wrote:Any idea how to make this work with F1-F12 keys?

Code: Select all

WinRing0.KeyPress("f1")
raskun
Posts: 13
Joined: 01 Mar 2017, 20:30

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-18)

05 Mar 2017, 06:19

But it wont work for example I tried it with a loop by pressing F1 when pressing itself

$f1::
loop
{
if not GetKeyState("f1", "P")
break
WinRing0.KeyPress("f1")
}

Its like making a soft press same with DD_Class

Try that code and see if it works or not
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-18)

05 Mar 2017, 06:29

I think the "$" symbo is only working for the builtin command (Send, SendInput, etc.)
raskun
Posts: 13
Joined: 01 Mar 2017, 20:30

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-18)

05 Mar 2017, 06:35

I see, but with your previous post from the DD Thread, using the timer is the same with the $ symbol. is there any way for it to work when pressing itself?
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: WinRing0 - Send keys in Hardware-Level (update on 2017-01-18)

05 Mar 2017, 06:55

The following two approaches seems worked.

Code: Select all

$a::
	Hotkey, $a, Off

	WinRing0.KeyPress("a")
	
	Hotkey, $a, On
return

Code: Select all

#If !running
$a::
	running := true

	WinRing0.KeyPress("a")
	
	running := false
return

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 133 guests