public static ulong AllocateAndWrite(this Process process, byte[] buffer, NT.AllocationType allocationType, NT.MemoryProtection memoryProtection) { ulong allocatedMemory = process.AllocateMemory((uint)buffer.Length, allocationType, memoryProtection); process.WriteRawMemory(buffer, allocatedMemory); return(allocatedMemory); }
public static ulong AllocateMemory(this Process process, uint length, NT.AllocationType allocationType, NT.MemoryProtection memoryProtection) => NT.VirtualAllocEx(process.Handle, 0, length, allocationType, memoryProtection);