kihlh / hmc-win32

HMC Easier Access to System APIs 简化连接winapi的过程的node c++模块

Home Page:https://kihlh.gitbook.io/hmc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

修复 getDetailsProcessList,getProcessList,getProcessidFilePath,getProcessName 对于 内核进程/ 服务进程 无效

kihlh opened this issue · comments

commented
commented

使用三种方式对主进程的镜像文件进行获取

image

image

commented

内核进程 ntoskrnl.exe 的进程几乎都是无权限访问的,在进程镜像中显示由于win32 进程是4的倍数 所以 4 大概率是ntoskrnl.exe
而 80以内大概率都是内核程序 获取0-80的快照非常快,所以从快照中查找此进程特征进行判断 第一次出现的无名 L"System" 是ntoskrnl.exe 而ntoskrnl.exe路径是固定的 "C:\Windows\System32\ntoskrnl.exe"
那么现在我们就可以确认 80以内 父进程是ntoskrnl.exe的进程也是ntoskrnl.exe

至于 Registry 这个无从查起因为任务管理器也找不到此应用归属

image

commented

放弃使用 GetModuleBaseNameA api

"System"等内核进程,可以参考PowerShell或C#,只提供Name,不提供Path
Get-Process -Id 4
(Get-Process -Id 4).Name
(Get-Process -Id 4).Path

查看属性定义
Get-Process| Get-Member

@kihlh

commented

"System"等内核进程,可以参考PowerShell或C#,只提供Name,不提供Path Get-Process -Id 4 (Get-Process -Id 4).Name (Get-Process -Id 4).Path

查看属性定义 Get-Process| Get-Member

@kihlh

不考虑调用shell获取,因为太慢了而且困难从从,此问题已经解决了 现在只需要格式化几个内核程序的实际路径就完成了
image

你误解了我的意思了。我的意思是,内核进程的Path就直接返回空字符串好了。C#的API就是这么做的。 @kihlh

commented

此需求被合并到 #30