mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 20:24:16 +01:00
fix: use longer sig for AntiDebug
This commit is contained in:
parent
5df28e4e22
commit
add9fe89e4
1 changed files with 11 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Dalamud.Hooking;
|
using Dalamud.Hooking;
|
||||||
|
|
@ -14,12 +15,16 @@ namespace Dalamud.Game.Internal
|
||||||
public bool IsEnabled { get; private set; }
|
public bool IsEnabled { get; private set; }
|
||||||
|
|
||||||
public AntiDebug(SigScanner scanner) {
|
public AntiDebug(SigScanner scanner) {
|
||||||
DebugCheckAddress = scanner.ScanText("FF 15 ?? ?? ?? ?? 85 C0 74 11");
|
try {
|
||||||
|
DebugCheckAddress = scanner.ScanText("FF 15 ?? ?? ?? ?? 85 C0 74 11 41");
|
||||||
Log.Verbose("IsDebuggerPresent address {IsDebuggerPresent}", DebugCheckAddress);
|
} catch (KeyNotFoundException) {
|
||||||
|
DebugCheckAddress = IntPtr.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.Verbose("DebugCheck address {DebugCheckAddress}", DebugCheckAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly byte[] nop = new byte[] { 0x31, 0xC0, 0x90, 0x90, 0x90, 0x90 };
|
private readonly byte[] nop = new byte[] { 0x31, 0xC0, 0x90, 0x90, 0x90, 0x90, 0x90 };
|
||||||
private byte[] original;
|
private byte[] original;
|
||||||
|
|
||||||
public void Enable() {
|
public void Enable() {
|
||||||
|
|
@ -28,6 +33,8 @@ namespace Dalamud.Game.Internal
|
||||||
Log.Information($"Overwriting Debug Check @ 0x{DebugCheckAddress.ToInt64():X}");
|
Log.Information($"Overwriting Debug Check @ 0x{DebugCheckAddress.ToInt64():X}");
|
||||||
Marshal.Copy(DebugCheckAddress, this.original, 0, this.nop.Length);
|
Marshal.Copy(DebugCheckAddress, this.original, 0, this.nop.Length);
|
||||||
Marshal.Copy(this.nop, 0, DebugCheckAddress, this.nop.Length);
|
Marshal.Copy(this.nop, 0, DebugCheckAddress, this.nop.Length);
|
||||||
|
} else {
|
||||||
|
Log.Information("DebugCheck already overwritten?");
|
||||||
}
|
}
|
||||||
|
|
||||||
IsEnabled = true;
|
IsEnabled = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue