feat: add Pohky SafeMemory

This commit is contained in:
goat 2021-01-19 23:24:07 +01:00
parent f16d3f82bd
commit 3fe6e45b68
2 changed files with 260 additions and 2 deletions

View file

@ -31,8 +31,8 @@ namespace Dalamud.Game.Internal
this.original = new byte[this.nop.Length];
if (DebugCheckAddress != IntPtr.Zero && !IsEnabled) {
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);
SafeMemory.ReadBytes(DebugCheckAddress, this.nop.Length, out this.original);
SafeMemory.WriteBytes(DebugCheckAddress, this.nop);
} else {
Log.Information("DebugCheck already overwritten?");
}