大家好,
我想知道通过NtCreateProcess()能否拦截进程启动?在网上看到一篇文章,貌似说它不行:(http://www.codeproject.com/KB/system/soviet_protector.aspx)
文章中有一段说到:
Which native API functions should we hook? Although NtCreateProcess() seems to be the most obvious answer to the question, this answer is wrong - it is possible to create a process without calling this function. For example, CreateProcess() sets up process-related kernel-mode structures without calling NtCreateProcess(). Therefore, hooking NtCreateProcess() is of no help to us.
我也有类似感觉,但由于是新手不太肯定,也见过一些程序是用此函数拦的。
《深入解析windows操作系统第4版》潘爱民译,这本书第6章(P304)有讲进程创建,其中阶段2就是调用NtCreateProcess()来创建一个进程对像。P300页还第二段还提到了CreateProcess(还有CreateProcessAsUser,CreateProcessWithTokenW,CreateProcessWithLogon等)函数,加上304页提到的NtCreateProcess()很是疑惑。
《Windows NT 2000 Native API Reference》中有一句关于ZwCreateProcess()的:The process created does not contain any threads.说明此函数真只是创建了进程内核对象。 还有一句是:Related Win32 Functions:
CreateProcess, CreateProcessAsUser.说明,CreateProcess 函数确实跟
ZwCreateProcess()(NtCreateProcess())有关啊。如果,这两本书都是正确的话,那前面老外的话。。。