Exemplo n.º 1
0
 public void OpenPatchEditor(Node node, IHDEHost hdeHost, PatchHandle patchHandle = null)
 {
     PatchEditor.OpenCanvasOfNode(node, patchHandle);
     //setting the control also brings the window to front
     hdeHost.FiftyEditor = this;
     hdeHost.ShowVLEditor();
 }
Exemplo n.º 2
0
        public void Restore()
        {
            if (IsPatched)
            {
                Restore(_original, _patchHandle);
            }
            Debug.Assert(!IsPatched);

            _patchHandle = null;

            _original = null;
            _postfix  = null;
        }
Exemplo n.º 3
0
        private static void Restore(MethodBase original, PatchHandle patchHandle)
        {
            if (patchHandle == null)
            {
                throw new ArgumentNullException(nameof(patchHandle));
            }
            if (patchHandle.IsDisposed)
            {
                throw new InvalidOperationException($"{nameof(patchHandle)} is disposed!");
            }

            var originalCodeStart = Memory.GetMethodStart(original);

            Memory.WriteBytes(originalCodeStart, patchHandle.OverwrittenCode);

            patchHandle.Dispose();
        }
Exemplo n.º 4
0
 private Patch(MethodBase original, MethodInfo postfix, PatchHandle patchHandle)
 {
     _original    = original;
     _postfix     = postfix;
     _patchHandle = patchHandle;
 }