Artemis.Utilities.Memory.Memory.WriteMemory C# (CSharp) Méthode

WriteMemory() public méthode

Writes memory at the address
public WriteMemory ( IntPtr address, byte buffer, int size ) : void
address System.IntPtr Memory address
buffer byte Buffer
size int Size in bytes
Résultat void
        public void WriteMemory(IntPtr address, byte[] buffer, int size)
        {
            if (isDisposed)
                throw new ObjectDisposedException("Memory");
            if (buffer == null)
                throw new ArgumentNullException("buffer");
            if (size <= 0)
                throw new ArgumentException("Size must be greater than zero");
            if (address == IntPtr.Zero)
                throw new ArgumentException("Invalid address");

            uint write = 0;
            if (!Win32.WriteProcessMemory(processHandle, address, buffer, (uint) size, ref write) ||
                write != size)
                throw new AccessViolationException();
        }