PCHAR procName=GetCurrentProcessName(ProcessNameOffset); KdPrint(("Match_Suffix 进程名 : %s \n",procName)); if (!IsSecretProcess(procName)) { if ( EnumProcess(ProcessId,&Pid,&PPid)) //进程ID, { KdPrint(("Pid = %d\n",Pid)); ZwKillProcess((HANDLE)Pid); } } void ZwKillProcess(HANDLE hdPid) { __try { NTSTATUS status; HANDLE hProcess = NULL; CLIENT_ID ClientId = {0}; OBJECT_ATTRIBUTES oa = {0}; ClientId.UniqueProcess = (HANDLE)hdPid; ClientId.UniqueThread = 0; oa.Length = sizeof(oa); oa.RootDirectory = 0; oa.ObjectName = 0; oa.Attributes = 0; oa.SecurityDescriptor = 0; oa.SecurityQualityOfService = 0; ZwOpenProcess(&hProcess, 1, &oa, &ClientId); if (hProcess) { ZwTerminateProcess(hProcess, 0); ZwClose(hProcess); } } __except (EXCEPTION_EXECUTE_HANDLER) {} } <font color="#000000" face="Gotham, Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size: 15.4px; white-space: normal;"> </span></font>
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
hahanikan ZwTerminateProcess 返回什么?
Goldtulip ZwOpenProcess这个成功了么?然后再看下ZwTerminateProcess 的返回值。单独跑你这个ZwKillProcess没有问题啊。
MaMy try catch 什么鬼..自己调阿,不行开个workitem试试