Example #1
0
 public bool ResetMemoryProtection()
 {
     if (mp != ProcessExtensions.MemoryProtection.Empty)
     {
         return(ProcessExtensions.VirtualProtectEx(p, baseAddr, (IntPtr)Size, mp, out _));
     }
     return(false);
 }
Example #2
0
        public bool SetMemoryProtection(ProcessExtensions.MemProtection memoryProtection)
        {
            var result = ProcessExtensions.VirtualProtectEx(p, baseAddr, (IntPtr)Size, memoryProtection, out var _mp);

            if (result)
            {
                mp = _mp;
            }
            return(result);
        }
        public bool ResetMemoryProtection()
        {
            var    memoryProtection = mp;
            var    empty            = ProcessExtensions.MemProtection.Memory_Empty;
            IntPtr size             = (IntPtr)Size;

            bool memoryProtectionNotEmpty = memoryProtection != empty;

            ProcessExtensions.MemProtection ThrowOff;

            if (memoryProtectionNotEmpty)
            {
                return(ProcessExtensions.VirtualProtectEx(p, baseAddr, size, mp, out ThrowOff));
            }
            else
            {
                return(false);
            }
        }