0

我的代码正在使用未记录的winnt函数NtQuerySystemInformation()来获取所有正在运行的进程。虽然没有正式记录,但那里有很多第 3 方文档(http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/System%20Information/NtQuerySystemInformation.htmlhttp://www.exploit-monday .com/2013/06/undocumented-ntquerysysteminformation.html开头)。该函数是动态加载的(使用LoadLibrary()and GetProcAddress()),但为了方便起见,我将调用编写为直接调用NtQuerySystemInformation()

PSYSTEM_PROCESS_INFORMATION pspi = NULL;
ULONG info_length = 0;
NTSTATUS result = NtQuerySystemInformation(SystemProcessInformation, NULL , 0, &info_length);
pspi = (PSYSTEM_PROCESS_INFORMATION ) HeapAlloc ( .. , info_length , ..);
result = NtQuerySystemInformation(SystemProcessInformation, pspi , info_length, &info_length);
if ( result != NT_SUCESS ) return ;
while (..)
{
  ...

  cout << pspi.ImageName.buffer ; 

  ...
}

这个[伪]代码打印机器上运行的所有进程,除了调用进程。我不知道什么会导致这种行为。

4

0 回答 0