ExtraLanscapingToolsCommon.Redirection.RedirectionHelper.RevertJumpTo C# (CSharp) Method

RevertJumpTo() private static method

private static RevertJumpTo ( IntPtr site, RedirectCallsState state ) : void
site System.IntPtr
state RedirectCallsState
return void
        private static void RevertJumpTo(IntPtr site, RedirectCallsState state)
        {
            unsafe
            {
                byte* sitePtr = (byte*)site.ToPointer();
                *sitePtr = state.a; // mov r11, target
                *(sitePtr + 1) = state.b;
                *((ulong*)(sitePtr + 2)) = state.f;
                *(sitePtr + 10) = state.c; // jmp r11
                *(sitePtr + 11) = state.d;
                *(sitePtr + 12) = state.e;
            }
        }