Page 2 of 2

Re: WinRing0 - Send keys in Hardware-Level

Posted: 18 Aug 2016, 01:54
by tmplinshi
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

Re: WinRing0 - Send keys in Hardware-Level

Posted: 20 Aug 2016, 13:50
by vasili111
But is it harder for games to detect with this method?

Re: WinRing0 - Send keys in Hardware-Level

Posted: 16 Jan 2017, 12:24
by qwerqwer
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.

Re: WinRing0 - Send keys in Hardware-Level

Posted: 17 Jan 2017, 01:14
by tmplinshi
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()

Re: WinRing0 - Send keys in Hardware-Level

Posted: 17 Jan 2017, 09:19
by qwerqwer
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.

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

Posted: 17 Jan 2017, 09:54
by tmplinshi
@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.

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

Posted: 17 Jan 2017, 10:24
by Nextron
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?

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

Posted: 17 Jan 2017, 10:45
by qwerqwer
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!

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

Posted: 17 Jan 2017, 15:02
by tmplinshi
@Nextron I guess so.
@qwerqwer Try another library DD --> https://autohotkey.com/boards/viewtopic.php?f=6&t=27007

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

Posted: 17 Jan 2017, 15:57
by qwerqwer
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.

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

Posted: 05 Mar 2017, 06:05
by raskun
Any idea how to make this work with F1-F12 keys?

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

Posted: 05 Mar 2017, 06:13
by tmplinshi
raskun wrote:Any idea how to make this work with F1-F12 keys?

Code: Select all

WinRing0.KeyPress("f1")

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

Posted: 05 Mar 2017, 06:19
by raskun
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

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

Posted: 05 Mar 2017, 06:29
by tmplinshi
I think the "$" symbo is only working for the builtin command (Send, SendInput, etc.)

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

Posted: 05 Mar 2017, 06:35
by raskun
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?

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

Posted: 05 Mar 2017, 06:55
by tmplinshi
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