mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-21 23:37:44 +01:00
Un-whether-or-not the codebase
This commit is contained in:
parent
f4102db488
commit
731d7e0f6e
59 changed files with 249 additions and 249 deletions
|
|
@ -11,7 +11,7 @@ namespace Dalamud.Game.Addon.Lifecycle;
|
|||
internal class AddonSetupHook<T> : IDisposable where T : Delegate
|
||||
{
|
||||
private readonly Reloaded.Hooks.AsmHook asmHook;
|
||||
|
||||
|
||||
private T? detour;
|
||||
private bool activated;
|
||||
|
||||
|
|
@ -30,22 +30,22 @@ internal class AddonSetupHook<T> : IDisposable where T : Delegate
|
|||
"use64",
|
||||
$"mov r9, 0x{detourPtr:X8}",
|
||||
};
|
||||
|
||||
|
||||
var opt = new AsmHookOptions
|
||||
{
|
||||
PreferRelativeJump = true,
|
||||
Behaviour = Reloaded.Hooks.Definitions.Enums.AsmHookBehaviour.DoNotExecuteOriginal,
|
||||
MaxOpcodeSize = 5,
|
||||
};
|
||||
|
||||
|
||||
this.asmHook = new Reloaded.Hooks.AsmHook(code, (nuint)address, opt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether or not the hook is enabled.
|
||||
/// Gets a value indicating whether the hook is enabled.
|
||||
/// </summary>
|
||||
public bool IsEnabled => this.asmHook.IsEnabled;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Starts intercepting a call to the function.
|
||||
/// </summary>
|
||||
|
|
@ -57,7 +57,7 @@ internal class AddonSetupHook<T> : IDisposable where T : Delegate
|
|||
this.asmHook.Activate();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.asmHook.Enable();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue