Example #1
0
 public IntPtr[] ScanArray(Process P, string ArrayString)
 {
     EnablePrivileges.GoDebugPriv();
     IntPtr[] array = new IntPtr[1];
     if (P == null)
     {
         return(new IntPtr[1]);
     }
     this.Attacked = Process.GetProcessById(P.Id);
     string[] array2 = ArrayString.Split(new char[]
     {
         " "[0]
     });
     for (int i = 0; i < array2.Length; i++)
     {
         if (array2[i] == "?")
         {
             array2[i] = "??";
         }
     }
     this.MappedMemory = new List <MEMORY_BASIC_INFORMATION>();
     this.MemInfo(this.Attacked.Handle);
     for (int j = 0; j < this.MappedMemory.Count; j++)
     {
         byte[] array3 = new byte[this.MappedMemory[j].RegionSize];
         Kernel__.ReadProcessMemory(this.Attacked.Handle, this.MappedMemory[j].BaseAddress, array3, this.MappedMemory[j].RegionSize, 0);
         IntPtr value = IntPtr.Zero;
         if (array3.Length != 0)
         {
             value = this.ScanInBuff(this.MappedMemory[j].BaseAddress, array3, array2);
         }
         if (this.StopTheFirst && value != IntPtr.Zero)
         {
             array    = new IntPtr[0];
             array[0] = (IntPtr)(this.MappedMemory[j].BaseAddress.ToInt32() + value.ToInt32());
             return(array);
         }
     }
     if (!this.StopTheFirst && this.AddressList.Count > 0)
     {
         array = new IntPtr[this.AddressList.Count];
         for (int k = 0; k < this.AddressList.Count; k++)
         {
             array[k] = this.AddressList[k];
         }
         this.AddressList.Clear();
         return(array);
     }
     return(array);
 }