我是用CreateToolhelp32Snapshot枚举到所有进程
然后指定一个进程,想得到该进程的主线程ID
结构里貌似没这个主线程ID,请问怎么得到呢?
然后指定一个进程,想得到该进程的主线程ID
结构里貌似没这个主线程ID,请问怎么得到呢?
解决方案 »
- vs2008有什么好用的图像处理类吗
- <一个程序员的一天>自己的真情实感
- 列表控件(CListCtrl)为何不能调整列宽了呢???
- 新手问题“请问这是什么变量,怎么设置?”
- 如何改变静态文本框中字符串的颜色
- 请问VC里有哪些已经做好的表格控件?
- 请教:窗口分割的问题!
- 100分求助代码优化,转贴http://community.csdn.net/Expert/topic/3260/3260085.xml?temp=.9195673
- definition of dllimport data not allowed error?
- 如何把unicode编码的文字写的文件中呀
- 线程 消息 参数
- 如何查找数据库中某项记录?
不知道谁有这样的例子代码,我现在只知道进程的ID或者进程名
typedef struct tagTHREADENTRY32 { DWORD dwSize; DWORD cntUsage; DWORD th32ThreadID; DWORD th32OwnerProcessID; LONG tpBasePri; LONG tpDeltaPri; DWORD dwFlags;
} THREADENTRY32, *PTHREADENTRY32;
dwSize
Size of the structure, in bytes. Before calling the Thread32First function, set this member to sizeof(THREADENTRY32). If you do not initialize dwSize, Thread32First fails.
cntUsage
This member is no longer used and is always set to zero.
th32ThreadID
Thread identifier, compatible with the thread identifier returned by the CreateProcess function.
th32OwnerProcessID
Identifier of the process that created the thread.
tpBasePri
Initial priority level assigned to a thread. This member can be one of the following values (defined in Winbase.h and Winnt.h).
直接用最简单的IAT HOOK
注射到目标线程,获取目标线程基址,修改导入表的connect函数。即可,