BananaHook.Infrastructure.Patch.Apply C# (CSharp) Method

Apply() public method

public Apply ( ) : void
return void
        public void Apply()
        {
            if (IsApplied) return;

            _protector.ExecuteWithProtection(MemoryProtectionConstraints.PAGE_EXECUTE_READWRITE, () =>
            {
                _original = _memory.ReadBytes(TargetAddress, _replaceWith.Length);
                _memory.WriteBytes(TargetAddress, _replaceWith);
            });
            IsApplied = true;
        }