feat: add checkbox for AntiDebug to dev menu

This commit is contained in:
goat 2020-03-24 22:44:21 +09:00
parent 0a227fd2b7
commit 00b263f08e
3 changed files with 18 additions and 8 deletions

View file

@ -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();

View file

@ -25,7 +25,7 @@ namespace Dalamud.Game.Internal
}
public void Enable() {
//this.debuggerPresentHook.Enable();
this.debuggerPresentHook.Enable();
}
public void Dispose() {

View file

@ -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();