C++ 暂停Windows文件保护
生活随笔
收集整理的這篇文章主要介紹了
C++ 暂停Windows文件保护
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
C++ 暫停Windows文件保護
Posted by JiaJia 13 February,2009 (0)Comment #include <stdio.h>#include <windows.h>
typedef DWORD(__stdcall *CPP) (DWORD param1, PWCHAR param2, DWORD param3);
void Disable_WFP()
{
HINSTANCE hmod=LoadLibrary("sfc_os.dll");
CPP SetSfcFileException;
// the function is stored at the fifth ordinal in sfc_os.dll
SetSfcFileException= (CPP)GetProcAddress(hmod,(LPCSTR)5);
SetSfcFileException(0, L"c://windows//system32//calc.exe",-1);
//Now we can modify the system file in a complete stealth.
}
void main()
{
Disable_WFP();
}
運行后,刪除 C:/WINDOWS/SYSTEM32/CALC.EXE 文件,不會自動恢復
Windows2K3 CN SP1 VC6 測試通過
好像說重啟后會恢復,這個未測試,所以叫暫停。
總結
以上是生活随笔為你收集整理的C++ 暂停Windows文件保护的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: VB 字节数组和字符串的转换问题 (St
- 下一篇: VC++下Window剪贴板的操作