uintptr_t get_ntos_base()
{
auto Idt_base
=
reinterpret_cast<uintptr_t>(KeGetPcr()
-
>IdtBase);
auto align_page
=
*
reinterpret_cast<uintptr_t
*
>(Idt_base
+
4
) >>
0xc
<<
0xc
;
for
(; align_page; align_page
-
=
PAGE_SIZE)
{
for
(
int
index
=
0
; index < PAGE_SIZE
-
0x7
; index
+
+
)
{
auto current_address
=
static_cast<intptr_t>(align_page)
+
index;
if
(
*
reinterpret_cast<uint8_t
*
>(current_address)
=
=
0x48
&&
*
reinterpret_cast<uint8_t
*
>(current_address
+
1
)
=
=
0x8D
&&
*
reinterpret_cast<uint8_t
*
>(current_address
+
2
)
=
=
0x1D
&&
*
reinterpret_cast<uint8_t
*
>(current_address
+
6
)
=
=
0xFF
)
/
/
48
8d
1D
?? ?? ?? FF
{
auto nto_base_offset
=
*
reinterpret_cast<
int
*
>(current_address
+
3
);
auto nto_base_
=
(current_address
+
nto_base_offset
+
7
);
if
(!(nto_base_ &
0xfff
))
{
return
nto_base_;
}
}
}
}
return
0
;
}