Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我遇到了一个奇怪的问题:
在“系统”进程的线程中,我调用PsGetCurrentProcessId()了 ,但得到了一个空值。
PsGetCurrentProcessId()
此外,我检查了线程的_CLIENT_ID,发现UniqueProcess 和UniqueThread 都为空。
我还检查了当前进程,即“系统”进程,发现它的UniqueProcessId 为4,这是正常的。
为什么?
系统进程 ID 是一个非常好的“hack”,因此多个工具(例如 ProcExp、windbg)不必针对特殊情况的内核线程或空闲函数调度程序。
如果您是仅内核线程,则没有关联的进程(除非您攻击自己)。