Как можо завершить процесс из драйвера,зная только имя процесса(на асме)? пробовал через ZwOpenProcess ,но не понял какие параметры передавать.
777user777 NtOpenProcess открывает процесс по имени обьекта(это имя никак не связано с именем модуля) либо по PID.
777user777 Вначале следует прототип функции изучить. Если всёже не понятно(что там может быть не понятного %), то можно посмотреть как это реализовано в пользовательском стабе: Код (Text): HANDLE WINAPI OpenProcess( DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId ) /*++ Routine Description: A handle to a process object may be created using OpenProcess. Opening a process creates a handle to the specified process. Associated with the process handle is a set of access rights that may be performed using the process handle. The caller specifies the desired access to the process using the DesiredAccess parameter. Arguments: mDesiredAccess - Supplies the desired access to the process object. For NT/Win32, this access is checked against any security descriptor on the target process. The following object type specific access flags can be specified in addition to the STANDARD_RIGHTS_REQUIRED access flags. DesiredAccess Flags: PROCESS_DUP_HANDLE - Duplicate object access to the process is desired. This access is required in order to duplicate an object handle into or out of a process. PROCESS_QUERY_INFORMATION - This access is required to read certain information from the process object. PROCESS_VM_READ - This access is required to read the memory of another process. PROCESS_VM_WRITE - This access is required to write the memory of another process. SYNCHRONIZE - This access is required to wait on a process object. PROCESS_ALL_ACCESS - This set of access flags specifies all of the possible access flags for a process object. bInheritHandle - Supplies a flag that indicates whether or not the returned handle is to be inherited by a new process during process creation. A value of TRUE indicates that the new process will inherit the handle. dwProcessId - Supplies the process id of the process to open. Return Value: NON-NULL - Returns an open handle to the specified process. The handle may be used by the calling process in any API that requires a handle to a process. If the open is successful, the handle is granted access to the process object only to the extent that it requested access through the DesiredAccess parameter. NULL - The operation failed. Extended error status is available using GetLastError. --*/ { NTSTATUS Status; OBJECT_ATTRIBUTES Obja; HANDLE Handle; CLIENT_ID ClientId; ClientId.UniqueThread = (HANDLE)NULL; ClientId.UniqueProcess = (HANDLE)LongToHandle(dwProcessId); InitializeObjectAttributes( &Obja, NULL, (bInheritHandle ? OBJ_INHERIT : 0), NULL, NULL ); Status = NtOpenProcess( &Handle, (ACCESS_MASK)dwDesiredAccess, &Obja, &ClientId ); if ( NT_SUCCESS(Status) ) { return Handle; } else { BaseSetLastNTError(Status); return NULL; } } А вообщем рано есчо вам в ядре лазить.
искал уже,но ничего полезного не нашёл... даже не сказано где эта функция(я так понял что в ntoskrnl.exe)
777user777 Плохо ищешь http://bbs.pediy.com/archive/index.php?t-116885.html http://hi.baidu.com/darkroot/blog/item/b9e9cc1f4b46a3c1a686695a.html Достаточно в гугле просто вбить PspTerminateThreadByPointer
777user777 Давайте подумаем вместе. Начинайте размышлять. Какие усилия вы приложили для решения данного вопроса ?