public Context(Process process) { isContext64 = process.IsWin64; if (process.IsWin64) { context64 = new CONTEXT(); context64.ContextFlags = CONTEXT_FLAGS.CONTEXT_ALL; } else { context32 = new Context32(); context32.ContextFlags = CONTEXT_FLAGS.CONTEXT_ALL; } }
public Context(Process process, IntPtr hThread) { isContext64 = process.IsWin64; if (process.IsWin64) { context64 = new CONTEXT(); context64.ContextFlags = CONTEXT_FLAGS.CONTEXT_ALL; } else { context32 = new Context32(); context32.ContextFlags = CONTEXT_FLAGS.CONTEXT_ALL; } GetContext(hThread); //if (!GetContext(hThread)) // throw new Exception("Failed to GetContext(), get last error: " + Debugger.GetLastError().ToString()); }
static extern bool Wow64SetThreadContext(IntPtr hThread, [In] ref Context32 lpContext);
static extern bool Wow64GetThreadContext(IntPtr hThread, ref Context32 lpContext);
public Context(Context32 context32) { isContext64 = false; this.context32 = context32; }