Hero
October 7th, 2006, 06:28
Hi all
I wrote a small code in my VS,but I saw an strange result.Here is my code:
The code is simple,And I get TRUE for result of GetThreadContext,but when I checked the value of Eip in CONTEXT structure(c),I see that its value is starnge and equal to:
Eip = 0x7c4e87b3
What happen?Is there anything wrong with my code?What is the problem?
sincerely yours
I wrote a small code in my VS,but I saw an strange result.Here is my code:
Code:
int main(int argv,char* argc)
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
ZeroMemory(&si,sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.wShowWindow = SW_NORMAL;
CreateProcess("d:\\winnt\\system32\\calc.exe","",NULL,NULL,TRUE,CREATE_SUSPENDED,NULL,NULL,&si,&pi);
CONTEXT c;
c.ContextFlags = CONTEXT_FULL;
HANDLE h = OpenThread(THREAD_QUERY_INFORMATION | THREAD_GET_CONTEXT | THREAD_SET_CONTEXT, TRUE, pi.dwThreadId);
BOOL res = GetThreadContext(h,&c);
}
The code is simple,And I get TRUE for result of GetThreadContext,but when I checked the value of Eip in CONTEXT structure(c),I see that its value is starnge and equal to:
Eip = 0x7c4e87b3
What happen?Is there anything wrong with my code?What is the problem?
sincerely yours