VirtualProtect(System.IntPtr、System.IntPtr、uint、out uint)

本文关键字:IntPtr uint System out VirtualProtect | 更新日期: 2023-09-27 17:59:00

嗨,有人能帮我解决这个错误吗!

 [DllImport("kernel32.dll")]
 [return: MarshalAs(UnmanagedType.Bool)]
 private static bool VirtualProtect(IntPtr intptr_0, IntPtr intptr_1, uint uint_0, out uint uint_1);
 private unsafe int method_2(byte?[] nullable_0, int int_1 = 1, int int_2 = 16777216, int int_3 = 63963136)
 {
   byte* numPtr = (byte*) null;
   int num1;
   try
   {
     int num2 = 0;
     for (int index1 = int_2; index1 < int_3; ++index1)
     {
       numPtr = (byte*) index1;
       bool flag = false;
       for (int index2 = 0; index2 < nullable_0.Length; ++index2)
       {
         if (nullable_0[index2].HasValue)
         {
           int num3 = (int) *numPtr;
           byte? nullable = nullable_0[index2];
           if ((num3 != (int) nullable.GetValueOrDefault() ? 1 : (!nullable.HasValue ? 1 : 0)) != 0)
             break;
         }
         if (index2 == nullable_0.Length - 1)
         {
           if (int_1 == 1)
           {
             flag = true;
           }
           else
           {
             ++num2;
             if (num2 == int_1)
               flag = true;
           }
         }
         else
           ++numPtr;
       }
       if (flag)
       {
         num1 = index1;
         goto label_19;
       }
     }
   }
   catch (Exception ex)
   {
     Log.Write(InfinityScript.LogLevel.Error, string.Concat(new object[4]
     {
       (object) "FindMem: ",
       (object) ex.Message,
       (object) "'nAddress: ",
       (object) (int) numPtr
     }));
   }
   num1 = 0; label_19:
   return num1;
 }

提前感谢

VirtualProtect(System.IntPtr、System.IntPtr、uint、out uint)

如消息所示,将其标记为extern