diff --git a/Dalamud/Dalamud.cs b/Dalamud/Dalamud.cs index 3f6af4d24..5717669a9 100644 --- a/Dalamud/Dalamud.cs +++ b/Dalamud/Dalamud.cs @@ -58,6 +58,9 @@ namespace Dalamud { public readonly DataManager Data; + private AntiDebug antiDebug; + + private readonly string assemblyVersion = Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version.ToString(); public Dalamud(DalamudStartInfo info) { @@ -153,6 +156,8 @@ namespace Dalamud { this.WinSock2.Dispose(); this.SigScanner.Dispose(); + + this.antiDebug?.Dispose(); } #region Interface @@ -165,6 +170,8 @@ namespace Dalamud { private bool isImguiDrawDevMenu = false; #endif + private bool isAntiDebugEnabled = false; + private bool isImguiDrawLogWindow = false; private bool isImguiDrawDataWindow = false; private bool isImguiDrawPluginWindow = false; @@ -204,6 +211,15 @@ namespace Dalamud { } ImGui.MenuItem("Draw ImGui demo", "", ref this.isImguiDrawDemoWindow); ImGui.Separator(); + if (ImGui.MenuItem("Enable AntiDebug", "", ref this.isAntiDebugEnabled)) { + if (this.isAntiDebugEnabled) { + this.antiDebug = new AntiDebug(); + this.antiDebug.Enable(); + } else { + this.antiDebug?.Dispose(); + } + } + ImGui.Separator(); if (ImGui.MenuItem("Unload Dalamud")) { Unload(); diff --git a/Dalamud/Game/Internal/AntiDebug.cs b/Dalamud/Game/Internal/AntiDebug.cs index 54ec19da2..6ce25488b 100644 --- a/Dalamud/Game/Internal/AntiDebug.cs +++ b/Dalamud/Game/Internal/AntiDebug.cs @@ -25,7 +25,7 @@ namespace Dalamud.Game.Internal } public void Enable() { - //this.debuggerPresentHook.Enable(); + this.debuggerPresentHook.Enable(); } public void Dispose() { diff --git a/Dalamud/Game/Internal/Framework.cs b/Dalamud/Game/Internal/Framework.cs index 098625857..54e37c224 100644 --- a/Dalamud/Game/Internal/Framework.cs +++ b/Dalamud/Game/Internal/Framework.cs @@ -43,9 +43,7 @@ namespace Dalamud.Game.Internal { public LibcFunction Libc { get; private set; } - private AntiDebug antiDebug; - -#endregion + #endregion public Framework(SigScanner scanner, Dalamud dalamud) { Address = new FrameworkAddressResolver(); @@ -67,8 +65,6 @@ namespace Dalamud.Game.Internal { Network = new GameNetwork(dalamud, scanner); //Resource = new ResourceManager(dalamud, scanner); - - this.antiDebug = new AntiDebug(); } private void HookVTable() { @@ -85,7 +81,6 @@ namespace Dalamud.Game.Internal { } public void Enable() { - this.antiDebug.Enable(); Gui.Enable(); Network.Enable(); //Resource.Enable(); @@ -94,7 +89,6 @@ namespace Dalamud.Game.Internal { } public void Dispose() { - this.antiDebug.Dispose(); Gui.Dispose(); Network.Dispose(); //Resource.Dispose();