Merge pull request #388 from Philpax/persistent-anti-anti-debug

This commit is contained in:
goaaats 2021-07-11 00:41:42 +02:00 committed by GitHub
commit 60d58b8941
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 3 deletions

View file

@ -138,6 +138,11 @@ namespace Dalamud.Configuration
/// </summary>
public bool IsGamepadNavigationEnabled { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether or not the anti-anti-debug check is enabled on startup.
/// </summary>
public bool IsAntiAntiDebugEnabled { get; set; } = false;
/// <summary>
/// Load a configuration from the provided path.
/// </summary>

View file

@ -229,7 +229,10 @@ namespace Dalamud
this.Configuration = DalamudConfiguration.Load(this.StartInfo.ConfigurationPath);
this.AntiDebug = new AntiDebug(this.SigScanner);
if (this.Configuration.IsAntiAntiDebugEnabled)
this.AntiDebug.Enable();
#if DEBUG
if (!this.AntiDebug.IsEnabled)
this.AntiDebug.Enable();
#endif

View file

@ -35,7 +35,7 @@ namespace Dalamud.Game.Internal
/// <summary>
/// Gets a value indicating whether the anti-debugging is enabled.
/// </summary>
public bool IsEnabled { get; private set; }
public bool IsEnabled { get; private set; } = false;
/// <summary>
/// Enables the anti-debugging by overwriting code in memory.

View file

@ -198,7 +198,14 @@ namespace Dalamud.Interface
if (ImGui.MenuItem("Enable AntiDebug", null, this.dalamud.AntiDebug.IsEnabled))
{
var newEnabled = !this.dalamud.AntiDebug.IsEnabled;
if (newEnabled)
this.dalamud.AntiDebug.Enable();
else
this.dalamud.AntiDebug.Disable();
this.dalamud.Configuration.IsAntiAntiDebugEnabled = newEnabled;
this.dalamud.Configuration.Save();
}
ImGui.Separator();