uint8_t
*
KiNmiInProgress
=
NULL;
if
(dwBuildNumber <
22000
)
/
/
win10
{
KiNmiInProgress
=
reinterpret_cast<uint8_t
*
>(FindPatternInSectionAtKernel((char
*
)
".text"
, ntoskrnlAddr, (PUCHAR)
"\x81\x25\x00\x00\x00\x00\x00\x00\x00\x00\xB9\x00\x00\x00\x00"
, (char
*
)
"xx????????x????"
));
}
else
/
/
win11
{
KiNmiInProgress
=
reinterpret_cast<uint8_t
*
>(FindPatternInSectionAtKernel((char
*
)
".text"
, ntoskrnlAddr, (PUCHAR)
"\x81\x25\x00\x00\x00\x00\x00\x00\x00\x00\x8D\x00\x00"
, (char
*
)
"xx????????x??"
));
}
if
(KiNmiInProgress)
{
uint8_t uTemp
=
this
-
>read_virtual<uint8_t>((void
*
)KiNmiInProgress);
while
(uTemp !
=
0x48
)
{
+
+
KiNmiInProgress;
uTemp
=
this
-
>read_virtual<uint8_t>((void
*
)KiNmiInProgress);
}
KiNmiInProgress
=
reinterpret_cast<uint8_t
*
>(ResolveRelativeAddress(KiNmiInProgress,
3
,
7
));
ULONG nCoreNum
=
this
-
>v_ctx
-
>kn_KeQueryActiveProcessorCountEx(
0
);
if
(nCoreNum)
{
for
(
int
i
=
0
; i < nCoreNum; i
+
+
)
{
this
-
>v_ctx
-
>kn_KeInterlockedSetProcessorAffinityEx((__int64)KiNmiInProgress, i);
}
}
return
true;
}
return
false;