拥有最高特权级 0后,为何还是不能访问内存空间
我已经把自己的应用程序由特权级 3 提升到最高特权级 0 后,为什么还是不能访问内存空间??代码如下:VC6 下编译
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
void RaisePrivleges()
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if(OpenProcessToken(GetCurrentProcess(),TOKEN_ALL_ACCESS,&hToken))
{
if (LookupPrivilegeValue(NULL,SE_DEBUG_NAME,&tkp.Privileges[0].Luid))
{
AdjustTokenPrivileges(hToken,FALSE,&tkp,0x10,(PTOKEN_PRIVILEGES)NULL,0);
}
}
if (hToken)
{
CloseHandle(hToken);
}
}
int main()
{
unsigned int var = 10;
unsigned int *ptr1 = &var;
unsigned int *ptr2 = (unsigned int *)0x0013ffffL;
printf("*(0x%08x)=",ptr1);
printf("0x%08x\n",*ptr1);
RaisePrivleges(); // 提升进程权限 ,使特权级为 0
printf("*(0x%08x)=",ptr2);
printf("0x%08x\n",*ptr2);
return 0;
}