Пример #1
0
 // Token: 0x0600000D RID: 13 RVA: 0x00002144 File Offset: 0x00000344
 public byte[] ReadByteArray(IntPtr pOffset, uint pSize)
 {
     if (this.processHandle == IntPtr.Zero)
     {
         this.CheckProcess();
     }
     byte[] result;
     try
     {
         uint flNewProtect;
         VAMemory.VirtualProtectEx(this.processHandle, pOffset, (UIntPtr)pSize, 4U, out flNewProtect);
         byte[] array = new byte[pSize];
         VAMemory.ReadProcessMemory(this.processHandle, pOffset, array, pSize, 0U);
         VAMemory.VirtualProtectEx(this.processHandle, pOffset, (UIntPtr)pSize, flNewProtect, out flNewProtect);
         result = array;
     }
     catch (Exception ex)
     {
         if (VAMemory.debugMode)
         {
             Console.WriteLine("Error: ReadByteArray" + ex.ToString());
         }
         result = new byte[1];
     }
     return(result);
 }
Пример #2
0
 public byte[] ReadByteArray(IntPtr pOffset, uint pSize)
 {
     if (this.processHandle == IntPtr.Zero)
     {
         this.CheckProcess();
     }
     try
     {
         uint lpflOldProtect;
         VAMemory.VirtualProtectEx(this.processHandle, pOffset, (UIntPtr)pSize, 4U, out lpflOldProtect);
         byte[] lpBuffer = new byte[pSize];
         VAMemory.ReadProcessMemory(this.processHandle, pOffset, lpBuffer, pSize, 0U);
         VAMemory.VirtualProtectEx(this.processHandle, pOffset, (UIntPtr)pSize, lpflOldProtect, out lpflOldProtect);
         return(lpBuffer);
     }
     catch (Exception ex)
     {
         if (VAMemory.debugMode)
         {
             Console.WriteLine("Error: ReadByteArray" + ex.ToString());
         }
         return(new byte[1]);
     }
 }