Ssdt tables cannot be written on many machines. Writing a table causes the machine to crash and restart without prompt. This requires removing write protection for core memory:
//----------------------------------------------------------------------
//
// Set core memory access protection
//
//----------------------------------------------------------------------
//
// Spinlock Protection
//
Static kspin_lock gs_matrix;
Static kirql gs_oldirql;
Static ulong cr0value = 0;
//
// Initialize the global data structures, when the driver is loading
//
Ntstatus
MMP rotection_loadinit ()
{
//
Keinitializespinlock (& gs_mmp rotectionspinlock );
Return STATUS_SUCCESS;
}
/* ++
Routine description:
Disable Windows NT/2000/XP memory protection to make the read-only memory zone writable
Arguments:
Return Value:
--*/
Void mmdisableprotection ()
{
Keacquirespinlock (& gs_mmp rotectionspinlock, & gs_oldirql );//--------{{
_ ASM
{
MoV eax, Cr0
MoV cr0value, eax
And eax, 0 xfffeffff
MoV Cr0, eax
}
}
/* ++
Routine description:
Recover Windows NT/2000/XP memory Protection
Arguments:
Return Value:
--*/
Void mmenableprotection ()
{
_ ASM
{
MoV eax, cr0value
MoV Cr0, eax
}
Kereleasespinlock (& gs_mmp rotectionspinlock, gs_oldirql );//--------}}
}