陆麟
转载请征得作者同意.
2000.3.12
.586p
BLD_COFF EQU 1
.model flat
.data
CR0VALUE DD 0
.code
public _DisableProtection@0,_EnableProtection@0
_DisableProtection@0 Proc
mov eax,cr0
mov CR0VALUE,eax
and eax,0fffeffffh
mov cr0,eax
ret
_DisableProtection@0 endp
_EnableProtection@0 Proc
mov eax,CR0VALUE
mov cr0,eax
ret
_EnableProtection@0 endp
END
在需要的时候可以调用该PROC.:)看HALPATCH FOR WIN2000版的框架代码.:)该代码已经在我的完整版的HALPATCH使用了.:)并且同样可以运行于NT4上.:)
extern void HalProcessorIdle(void);
extern void EnableProtection(void);
extern void DisableProtection(void);
DriverEntry(PDRIVER_OBJECT pdrv,PUNICODE_STRING pus){
//... Init and modify privalege
DisableProtection();
p=(int*)HalProcessorIdle;
(int)p+=2;
q=(int**)(*p);
if (**q==0xccc3f4fb){
**q=0xccc390fb;
}
//Restor old setting.:)
EnableProtection();
return 0;
}