fix: wrong variable for ptr in antidebug, oops

This commit is contained in:
goat 2020-12-06 01:14:14 +01:00
parent 6d54f44ed0
commit 3a0636b776

View file

@ -17,21 +17,20 @@ namespace Dalamud.Game.Internal
Log.Verbose("IsDebuggerPresent address {IsDebuggerPresent}", DebugCheckAddress);
}
private IntPtr scanAddress;
private readonly byte[] nop = new byte[] { 0x31, 0xC0, 0x90, 0x90, 0x90, 0x90 };
private byte[] original;
public void Enable() {
this.original = new byte[this.nop.Length];
if (DebugCheckAddress != IntPtr.Zero) {
Log.Information($"Overwriting Debug Check @ 0x{scanAddress.ToInt64():X}");
Log.Information($"Overwriting Debug Check @ 0x{DebugCheckAddress.ToInt64():X}");
Marshal.Copy(DebugCheckAddress, this.original, 0, this.nop.Length);
Marshal.Copy(this.nop, 0, DebugCheckAddress, this.nop.Length);
}
}
public void Dispose() {
if (this.scanAddress != IntPtr.Zero && this.original != null)
if (this.DebugCheckAddress != IntPtr.Zero && this.original != null)
Marshal.Copy(this.original, 0, DebugCheckAddress, this.nop.Length);
}
}