如何使用在窗口中使用C++从CreateToolhelp32Snapshot获取64/32位进程详细信息和进程信息

how to use get the both 64/32 bit process details and processInfo from the CreateToolhelp32Snapshot using C++ in windows

本文关键字:进程 获取 32位 CreateToolhelp32Snapshot 详细信息 信息 窗口 何使用 C++      更新时间:2023-10-16

如何从 CreateToolhelp32Snapshot 中提取 ProcesId、带有路径的可执行文件名、进程参数。 并将它们作为 javaObject 数组发送。

CreateToolhelp32Snapshot()的文档告诉您如何获取进程 ID 和文件名。 您可以使用 QueryFullProcessImageName()GetProcessImageFileName()GetModuleFileNameEx()

至于命令行参数,您需要通过使用NtQueryInformationProcess()来手动检索它,以检索指向进程PEB结构的指针,然后使用ReadProcessMemory()实际读取它。 PEB有一个包含参数的ProcessParameters成员。 有关更多详细信息,请参阅此文章:

使用 NtQueryInformationProcess 获取进程信息