部分核心代码如下,512就是csrss.exe的pid,进程打开了但是ObjectTypeNumber参数没有等于5的啊
ObjectTypeNumber参数等于5是什么意思啊?
ZwAllocateVirtualMemory(GetCurrentProcess(),&pBuf,0,&buflen,MEM_COMMIT,PAGE_READWRITE);
NTQUERYSYSTEMINFORMATION ZwQuerySystemInformation=(NTQUERYSYSTEMINFORMATION)GetProcAddress(hModule,"ZwQuerySystemInformation");
ZWDUPLICATEOBJECT ZwDuplicateObject=(ZWDUPLICATEOBJECT)GetProcAddress(hModule,"ZwDuplicateObject");
ZwQuerySystemInformation(SystemHandleInformation,pBuf,0x0400000,&buflen);
ULONG szHandleNum=*(ULONG *)pBuf;
PSYSTEM_HANDLE_INFORMATION h_info=(PSYSTEM_HANDLE_INFORMATION)((ULONG)pBuf+4);
for(ULONG i=0;i<szHandleNum;i++)
{
if((h_info->ProcessId==
512)&&(h_info->ObjectTypeNumber==5))
{
MessageBoxA(NULL,"找到游戏进程!",NULL,MB_OK);
ZwDuplicateObject(hProcess,(PHANDLE)h_info->Handle,GetCurrentProcess(),&hDup,0,0,DUPLICATE_SAME_ACCESS);
break;
}
h_info++;
}
MessageBoxA(NULL,"没有找到游戏进程!",NULL,MB_OK);
ZWFREEVIRTUALMEMORY ZwFreeVirtualMemory=(ZWFREEVIRTUALMEMORY)GetProcAddress(hModule,"ZwFreeVirtualMemory");
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!