Esempio n. 1
0
 internal static extern bool VirtualProtectEx(SafeProcessHandle processHandle, IntPtr baseAddress, int protectionSize, Enumerations.MemoryProtection protectionType, out Enumerations.MemoryProtection oldProtectionType);
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 internal static extern IntPtr VirtualAllocEx(SafeProcessHandle processHandle, IntPtr baseAddress, int allocationSize, Enumerations.AllocationType allocationType, Enumerations.MemoryProtection protectionType);