我ResumeThread一个线程,GetThreadContext获取eip,为什么都是在系统领空,而不是程序领空
代码附上
#include "stdafx.h"
#include <windows.h>
#include "Tlhelp32.h"
int main(int argc, char* argv[])
{
DWORD thId=0;
CONTEXT ct;
ct.ContextFlags=CONTEXT_CONTROL;
THREADENTRY32 th32;
th32.dwSize=sizeof(THREADENTRY32);
HANDLE h1=CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD,0);
BOOL ret=Thread32First(h1,&th32);
while(ret)
{
ret=Thread32Next(h1,&th32);
printf("ProcessId:%d ",th32.th32OwnerProcessID);
printf("ThreadId:%d\r\n",th32.th32ThreadID);
}
printf("请输入线程ID:\n");
scanf("%d",&thId);
printf("你输入的线程id是:%d\r\n",thId);
HANDLE h2=OpenThread (THREAD_ALL_ACCESS,FALSE,thId);
SuspendThread(h2);
GetThreadContext(h2,&ct);//CONTEXT_FULL
return 0;
}
eip如下:0x7c92e514
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课