@@ -147,31 +147,58 @@ BOOLEAN IsWindowBad(HANDLE hWnd)
147147
148148BOOLEAN HookKiDispatchException (PVOID HookedKiDispatchException, PVOID* OriginalKiDispatchException)
149149{
150- PVOID KernelTextSectionBase = 0 ;
151- ULONG64 KernelTextSectionSize = 0 ;
152- CHAR* Pattern = " \x8B\x00\x50\x00\x8B\x00\x58\x48\x8D\x4D\x00\xE8\x00\x00\x00\xFF\x8B\x55 " ;
153- CHAR* Mask = " x?x?x?xxxx?x???xxx" ;
150+ PVOID KernelSectionBase = 0 ;
151+ ULONG64 KernelSectionSize = 0 ;
152+ CHAR* Pattern = g_HyperHide.CurrentWindowsBuildNumber >= WINDOWS_11 ? " \x24\x00\x00\x41\xB1\x01\x48\x8D\x4C\x24\x00\xE8 " : " \x8B\x00\x50\x00\x8B\x00\x58\x48\x8D\x4D\x00\xE8\x00\x00\x00\xFF\x8B\x55 " ;
153+ CHAR* Mask = g_HyperHide.CurrentWindowsBuildNumber >= WINDOWS_11 ? " x??xxxxxxx?x" : " x?x?x?xxxx?x???xxx" ;
154+ CHAR* Section = g_HyperHide.CurrentWindowsBuildNumber >= WINDOWS_11 ? " PAGE" : " .text" ;
154155
155- if (GetSectionData (" ntoskrnl.exe" , " .text " , KernelTextSectionSize, KernelTextSectionBase ) == FALSE )
156+ if (GetSectionData (" ntoskrnl.exe" , Section, KernelSectionSize, KernelSectionBase ) == FALSE )
156157 return FALSE ;
157158
158- PVOID KiExceptionDispatchAddress = FindSignature (KernelTextSectionBase, KernelTextSectionSize , Pattern, Mask);
159- if ((ULONG64)KiExceptionDispatchAddress >= (ULONG64)KernelTextSectionBase && (ULONG64)KiExceptionDispatchAddress <= (ULONG64)KernelTextSectionBase + KernelTextSectionSize )
159+ PVOID KiDispatchExceptionAddress = FindSignature (KernelSectionBase, KernelSectionSize , Pattern, Mask);
160+ if ((ULONG64)KiDispatchExceptionAddress >= (ULONG64)KernelSectionBase && (ULONG64)KiDispatchExceptionAddress <= (ULONG64)KernelSectionBase + KernelSectionSize )
160161 {
161- KiExceptionDispatchAddress = (PVOID)(*(LONG*)((ULONG64)KiExceptionDispatchAddress + 12 ) + (LONGLONG)((ULONG64)KiExceptionDispatchAddress + 16 ));
162+ KiDispatchExceptionAddress = (PVOID)(*(LONG*)((ULONG64)KiDispatchExceptionAddress + 12 ) + (LONGLONG)((ULONG64)KiDispatchExceptionAddress + 16 ));
162163
163- LogInfo (" KiExceptionDispatch address: 0x%llx" , KiExceptionDispatchAddress );
164+ LogInfo (" KiDispatchException address: 0x%llx" , KiDispatchExceptionAddress );
164165
165- if ((ULONG64)KiExceptionDispatchAddress >= (ULONG64)KernelTextSectionBase && (ULONG64)KiExceptionDispatchAddress <= (ULONG64)KernelTextSectionBase + KernelTextSectionSize)
166- return hv::hook_function (KiExceptionDispatchAddress, HookedKiDispatchException, OriginalKiDispatchException);
166+ return hv::hook_function (KiDispatchExceptionAddress, HookedKiDispatchException, OriginalKiDispatchException);
167167 }
168168
169169 return FALSE ;
170170}
171171
172172VOID GetNtSyscallNumbers (NT_SYSCALL_NUMBERS &SyscallNumbers)
173173{
174- if (g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_20H2 || g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_20H1 || g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_21H1)
174+ if (g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_11)
175+ {
176+ SyscallNumbers.NtSetInformationThread = 0xd ;
177+ SyscallNumbers.NtQueryInformationProcess = 0x19 ;
178+ SyscallNumbers.NtQueryObject = 0x10 ;
179+ SyscallNumbers.NtSystemDebugControl = 0x1c8 ;
180+ SyscallNumbers.NtSetContextThread = 0x194 ;
181+ SyscallNumbers.NtQuerySystemInformation = 0x36 ;
182+ SyscallNumbers.NtGetContextThread = 0xf7 ;
183+ SyscallNumbers.NtClose = 0xf ;
184+ SyscallNumbers.NtQueryInformationThread = 0x25 ;
185+ SyscallNumbers.NtCreateThreadEx = 0xC5 ;
186+ SyscallNumbers.NtCreateFile = 0x55 ;
187+ SyscallNumbers.NtCreateProcessEx = 0x4d ;
188+ SyscallNumbers.NtYieldExecution = 0x46 ;
189+ SyscallNumbers.NtQuerySystemTime = 0x5a ;
190+ SyscallNumbers.NtQueryPerformanceCounter = 0x31 ;
191+ SyscallNumbers.NtContinue = 0xa3 ;
192+ SyscallNumbers.NtQueryInformationJobObject = 0x150 ;
193+ SyscallNumbers.NtCreateUserProcess = 0xcd ;
194+ SyscallNumbers.NtGetNextProcess = 0xfc ;
195+ SyscallNumbers.NtOpenProcess = 0x26 ;
196+ SyscallNumbers.NtOpenThread = 0x134 ;
197+ SyscallNumbers.NtSetInformationProcess = 0x1c ;
198+ }
199+
200+ else if (g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_20H2 || g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_20H1 ||
201+ g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_21H1 || g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_21H2)
175202 {
176203 SyscallNumbers.NtSetInformationThread = 0xd ;
177204 SyscallNumbers.NtQueryInformationProcess = 0x19 ;
@@ -486,7 +513,19 @@ VOID GetNtSyscallNumbers(NT_SYSCALL_NUMBERS &SyscallNumbers)
486513
487514VOID GetWin32kSyscallNumbers (WIN32K_SYSCALL_NUMBERS& SyscallNumbers)
488515{
489- if (g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_20H2 || g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_20H1 || g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_21H1)
516+ if (g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_11)
517+ {
518+ SyscallNumbers.NtUserFindWindowEx = 0x67 ;
519+ SyscallNumbers.NtUserBuildHwndList = 0x1a ;
520+ SyscallNumbers.NtUserQueryWindow = 0xe ;
521+ SyscallNumbers.NtUserGetForegroundWindow = 0x37 ;
522+ SyscallNumbers.NtUserGetThreadState = 0x0 ;
523+ SyscallNumbers.NtUserInternalGetWindowText = 0x5D ;
524+ SyscallNumbers.NtUserGetClassName = 0x74 ;
525+ }
526+
527+ if (g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_20H2 || g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_20H1 ||
528+ g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_21H1 || g_HyperHide.CurrentWindowsBuildNumber == WINDOWS_10_VERSION_21H2)
490529 {
491530 SyscallNumbers.NtUserFindWindowEx = 0x6c ;
492531 SyscallNumbers.NtUserBuildHwndList = 0x1c ;
0 commit comments