internal static extern bool VirtualProtectEx(SafeProcessHandle processHandle, IntPtr baseAddress, int protectionSize, Enumerations.MemoryProtection protectionType, out Enumerations.MemoryProtection oldProtectionType);
internal Enumerations.MemoryProtection ProtectVirtualMemory(IntPtr baseAddress, int protectionSize, Enumerations.MemoryProtection protectionType) { // Change the protection of a region of virtual memory in the remote process if (!PInvoke.VirtualProtectEx(_processHandle, baseAddress, protectionSize, protectionType, out var oldProtectionType)) { ExceptionHandler.ThrowWin32Exception("Failed to protect virtual memory in the remote process"); } return(oldProtectionType); }
internal static extern IntPtr VirtualAllocEx(SafeProcessHandle processHandle, IntPtr baseAddress, int allocationSize, Enumerations.AllocationType allocationType, Enumerations.MemoryProtection protectionType);