Ejemplo n.º 1
0
        private Win32.CONTEXT getContext(int threadId)
        {
            IntPtr hThread = getThreadHandle(threadId);

            Win32.CONTEXT ctx = new Win32.CONTEXT();
            ctx.ContextFlags = (uint)Win32.CONTEXT_FLAGS.CONTEXT_ALL;
            Win32.GetThreadContext(hThread, ref ctx);
            Context = ctx;
            return Context;
        }
Ejemplo n.º 2
0
        public Win32.CONTEXT ToWin32Context()
        {
            Win32.CONTEXT ctx = new Win32.CONTEXT();
            ctx.ContextFlags = ContextFlags;
            ctx.Dr0 = Dr0;
            ctx.Dr1 = Dr1;
            ctx.Dr2 = Dr2;
            ctx.Dr3 = Dr3;
            ctx.Dr6 = Dr6;
            ctx.Dr7 = Dr7;

            ctx.FloatSave = FloatSave;
            ctx.SegGs = SegGs;
            ctx.SegFs = SegFs;
            ctx.SegEs = SegEs;
            ctx.SegDs = SegDs;
            ctx.Edi = Edi;
            ctx.Esi = Esi;
            ctx.Ebx = Ebx;
            ctx.Edx = Edx;
            ctx.Ecx = Ecx;
            ctx.Eax = Eax;
            ctx.Ebp = Ebp;
            ctx.Eip = Eip;
            ctx.SegCs = SegCs;
            ctx.EFlags = EFlags;
            ctx.Esp = Esp;
            ctx.SegSs = SegSs;
            ctx.ExtendedRegisters = ExtendedRegisters;

            return ctx;
        }