ALFA.Shared.CodePatch.CodePatch C# (CSharp) Метод

CodePatch() публичный Метод

Create a code patch to change a function pointer.
public CodePatch ( IntPtr PatchOffset, IntPtr ReplacementFunction, bool Relative ) : System
PatchOffset System.IntPtr Supplies the patch offset.
ReplacementFunction System.IntPtr Supplies the replacement code /// pointer.
Relative bool Supplies true if the patch is relative. ///
Результат System
        public CodePatch(IntPtr PatchOffset, IntPtr ReplacementFunction, bool Relative)
        {
            byte[] Code = new byte[4];
            UInt32 Replacement;

            this.PatchOffset = PatchOffset;

            if (Relative)
                Replacement = (UInt32)ReplacementFunction - (UInt32)PatchOffset - 4;
            else
                Replacement = (UInt32)ReplacementFunction;

            Code[0] = (byte)(Replacement >> 0);
            Code[1] = (byte)(Replacement >> 8);
            Code[2] = (byte)(Replacement >> 16);
            Code[3] = (byte)(Replacement >> 24);

            OldCode = PatchCode(PatchOffset, Code);
        }

Same methods

CodePatch::CodePatch ( IntPtr PatchOffset, byte Code ) : System