Use kernel32. DLL CreateThread incoming program entry pointer, but what's wrong all don't, process will be closed directly, the following code will not perform, the incoming PE file, of course, also have no, really can't find the way, here to consult everybody, loading PE.net key code below
IntPtr threadStart=IntPtr. Add (codebase, (int) PE. OptionalHeader64. AOEP);
Console. WriteLine (" threadStart location: "+ threadStart (int));
IntPtr hThread=NativeDeclarations. CreateThread (IntPtr. Zero, Zero, threadStart, IntPtr. Zero, Zero, IntPtr. Zero).
NativeDeclarations. WaitForSingleObject (hThread, 0 XFFFFFFFF);
Then I introduced into c + + exe file, is open a calculator directly used as a test. That's all
Void main () {
//insert code here...
WinExec (" calc. Exe, "SW_SHOWMAXIMIZED);
}
Check some data if the program entry address is not correct to hThread return null? I decompiling, execution, and step by step to CreateThread this line of code, directly dropped out, I couldn't see what's wrong, and what is unusual,,
Beginner's development, code has a problem please point out, thank you.