public void Write(IntPtr addr, byte[] data) { if (!Native.WriteProcessMemory(_handle, addr, data, data.Length)) { throw new InjectorException("Failed to write process memory", new Win32Exception(Marshal.GetLastWin32Error())); } }
public void Write(IntPtr addr, byte[] data) { if (IsDriver) { KernelMemorySharp.MemoryDriver.WriteBytes(addr, data); } else if (!Native.WriteProcessMemory(_handle, addr, data, data.Length)) { throw new InjectorException("Failed to write process memory", new Win32Exception(Marshal.GetLastWin32Error())); } }