能力值:
( LV2,RANK:10 )
|
-
-
2 楼
HANDLE GetProcessKernelObject(DWORD ProcessId)
{
HMODULE hNtDll = NULL;
ZWQUERYSYSTEMINFORMATION pfnZwQuerySystemInformation = NULL;
NTQUERYOBJECT pfnNtQueryObject = NULL;
PSYSTEM_HANDLE_INFORMATION pSysHandleInfo = NULL;
POBJECT_ALL_INFORMATION pAllInfo =NULL;
POBJECT_NAME_INFORMATION pNameInfo = NULL;
ULONG nNumberHandle =0;
NTSTATUS ntStatus = 0;
ULONG ulSize,ulCount;
char cBuffer[0x80000],cInfoBuffer[0x10000];
hNtDll = GetModuleHandle(TEXT("ntdll.dll"));
pfnZwQuerySystemInformation = (ZWQUERYSYSTEMINFORMATION)GetProcAddress(hNtDll,"ZwQuerySystemInformation");
pfnNtQueryObject = (NTQUERYOBJECT)GetProcAddress(hNtDll,"NtQueryObject");
ntStatus = pfnZwQuerySystemInformation(SystemHandleInformation,cBuffer,0x80000,&ulSize);
if(NT_SUCCESS(ntStatus))
{
DWORD n = ulSize/sizeof(SYSTEM_HANDLE_INFORMATION);
nNumberHandle = *(PULONG)cBuffer;
pSysHandleInfo = (PSYSTEM_HANDLE_INFORMATION)(cBuffer +4);
ulCount = 0;
for(ULONG i=0;i!=nNumberHandle;++i)
{
if(pSysHandleInfo.ProcessId != ProcessId)
continue;
ntStatus = pfnNtQueryObject((HANDLE)pSysHandleInfo.Handle,ObjectAllInformation,cInfoBuffer,0x10000,&ulSize);
ntStatus = pfnNtQueryObject((HANDLE)pSysHandleInfo.Handle,ObjectNameInformation,cInfoBuffer,0x10000,&ulSize);
if(NT_SUCCESS(ntStatus))
{
pAllInfo = (POBJECT_ALL_INFORMATION)cInfoBuffer;
pNameInfo = (POBJECT_NAME_INFORMATION)cInfoBuffer;
if(_tcsstr(pNameInfo->NameBuffer,TEXT("QQGame_Mutex")) !=NULL)
{
return (HWND)pSysHandleInfo.Handle;
}
}
}
}
return NULL;
}
这是以前写的 多开QQ游戏大厅的代码,其中遍历了所有句柄
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
谢谢我看看。。。。
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
好多声明我都找不到 可以提供个完整的吗
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
http://topic.csdn.net/u/20100209/19/a03246ff-8cf7-42dc-abec-97a4b2386a72.html
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
我用NtQuerySystemInformation 获取了但是无法得到句柄的名称
求获取句柄名称代码 // ntStatus = pfnNtQueryObject((HANDLE)pSHinfo->Handles[dwIdx].Handle,ObjectNameInformation,cInfoBuffer,1024,&ulSize);
// if(NT_SUCCESS(ntStatus))
// {
//
// pNameInfo = (POBJECT_NAME_INFORMATION)cInfoBuffer;
//
// printf("%s\n",pNameInfo->Name);
// }
|
能力值:
(RANK:400 )
|
-
-
7 楼
根据句柄得到相应的对象,再在对象目录中查找相应的名称即可。
|
能力值:
( LV2,RANK:10 )
|
-
-
8 楼
得到句柄名必须要打开相应的进程吗 如何去关闭他 这些ring3下是否可以实现
|
|
|