fix win7 getNtSendInput

This commit is contained in:
2026-06-29 09:10:42 +08:00
parent 1a601fb2d3
commit 52a29890d2
8 changed files with 100 additions and 25 deletions
+7 -4
View File
@@ -6,8 +6,6 @@
#include "mouse_key_win10.h"
#include "mouse_key_win7.h"
namespace mouse_keybord_hook
{
unsigned char* _ntSendInput;
@@ -17,7 +15,12 @@ namespace mouse_keybord_hook
auto os = utils::GetVersion();
if (os.dwBuildNumber == 7600 || os.dwBuildNumber == 7601)
{
return NULL;
auto win32k = kernel_function::GetKernelModule("win32k.sys");
auto ntSendInput = (unsigned char*)utils::FindSectionsCode(win32k, "\x48\x8B\xC4\x48\x89\x58\x08\x48\x89\x70\x10\x48\x89\x78\x18\x41\x54\x48\x83\xEC\x60\x41\x8B\xD8",
"xxxxxxxxxxxxxxxxxxxxxxxx", ".text");
return ntSendInput;
}
else if (os.dwBuildNumber >= 26100)
{
@@ -60,7 +63,7 @@ namespace mouse_keybord_hook
auto os = utils::GetVersion();
if (os.dwBuildNumber == 7600 || os.dwBuildNumber == 7601)
{
inline_hooks_manager::fn_get_instance()->inline_install_hook(_ntSendInput, mouse_key_win7::hkNtUserSendInput, (void**)&origon_NtUserSendInput_win7);
}
else
{