ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs
(Generate patch)

Comparing trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs (file contents):
Revision 403 by william, Wed Jun 20 13:24:49 2012 UTC vs.
Revision 404 by william, Thu Jun 21 12:51:57 2012 UTC

# Line 10 | Line 10 | using Sojaner.MemoryScanner.MemoryProvie
10   using Microsoft.Win32.SafeHandles;
11   using Microsoft.Win32.Interop;
12   using System.ComponentModel;
13 + using ManagedWinapi;
14  
15   namespace Sojaner.MemoryScanner
16   {
# Line 19 | Line 20 | namespace Sojaner.MemoryScanner
20      //For more information refer to "Minesweeper, Behind the scenes" article by Arik Poznanski at Codeproject.com
21      internal class ProcessMemoryReader : IMemoryReader, IMemoryWriter, IFileWriter, IPatchMemory,IReadMemory
22      {
23 +        // constants information can be found in <winnt.h>
24 +        [Flags]
25 +        public enum ProcessAccessType
26 +        {
27 +            PROCESS_TERMINATE = (0x0001),
28 +            PROCESS_CREATE_THREAD = (0x0002),
29 +            PROCESS_SET_SESSIONID = (0x0004),
30 +            PROCESS_VM_OPERATION = (0x0008),
31 +            PROCESS_VM_READ = (0x0010),
32 +            PROCESS_VM_WRITE = (0x0020),
33 +            PROCESS_DUP_HANDLE = (0x0040),
34 +            PROCESS_CREATE_PROCESS = (0x0080),
35 +            PROCESS_SET_QUOTA = (0x0100),
36 +            PROCESS_SET_INFORMATION = (0x0200),
37 +            PROCESS_QUERY_INFORMATION = (0x0400)
38 +        }
39 +        [Flags]
40 +        public enum AllocationProtect : uint
41 +        {
42 +            // http://msdn.microsoft.com/en-us/library/windows/desktop/aa366786(v=vs.85).aspx
43 +            NONE = 0,
44 +            PAGE_NOACCESS = 0x00000001,
45 +            PAGE_READONLY = 0x00000002,
46 +            PAGE_READWRITE = 0x00000004,
47 +            PAGE_WRITECOPY = 0x00000008,
48 +            PAGE_EXECUTE = 0x00000010,
49 +            PAGE_EXECUTE_READ = 0x00000020,
50 +            PAGE_EXECUTE_READWRITE = 0x00000040,
51 +            PAGE_EXECUTE_WRITECOPY = 0x00000080,    
52 +            PAGE_GUARD = 0x00000100,
53 +            PAGE_NOCACHE = 0x00000200,
54 +            PAGE_WRITECOMBINE = 0x00000400
55 +        }
56 +        [StructLayout(LayoutKind.Sequential)]
57 +        public struct MEMORY_BASIC_INFORMATION
58 +        {
59 +            public IntPtr BaseAddress;
60 +            public IntPtr AllocationBase;
61 +            public AllocationProtect AllocationProtect;
62 +            public IntPtr RegionSize;
63 +            public uint State;
64 +            public uint Protect;
65 +            public uint Type;
66 +        }
67  
68          public ProcessMemoryReader()
69          {
# Line 49 | Line 94 | namespace Sojaner.MemoryScanner
94              try
95              {
96                  //                      m_hProcess = ProcessMemoryReaderApi.OpenProcess(ProcessMemoryReaderApi.PROCESS_VM_READ, 1, (uint)m_ReadProcess.Id);
97 <                ProcessMemoryReaderApi.ProcessAccessType access;
98 <                access = ProcessMemoryReaderApi.ProcessAccessType.PROCESS_VM_READ
99 <                    | ProcessMemoryReaderApi.ProcessAccessType.PROCESS_VM_WRITE
100 <                    | ProcessMemoryReaderApi.ProcessAccessType.PROCESS_VM_OPERATION;
101 <                m_hProcess = ProcessMemoryReaderApi.OpenProcess((uint)access, 1, (uint)m_ReadProcess.Id);
97 >                //if (!TokenAdjuster.AdjustProcessTokenPrivileges("SeDebugPrivilege"))
98 >                //{
99 >                //    logger.Warn.WriteLine("Failed to set SeDebugPrivilege on current process");
100 >                //}
101 >                ProcessAccessType access;
102 >                access = ProcessAccessType.PROCESS_VM_READ
103 >                    | ProcessAccessType.PROCESS_VM_WRITE
104 >                    | ProcessAccessType.PROCESS_VM_OPERATION;
105 >                //m_hProcess = ProcessMemoryReaderApi.OpenProcess((uint)access, 1, (uint)m_ReadProcess.Id);
106 >               m_hProcess = ProcessMemoryReaderApi.OpenProcess((uint)access, 1, (uint)m_ReadProcess.Id);
107              }
108              catch (SEHException ex)
109              {
# Line 72 | Line 122 | namespace Sojaner.MemoryScanner
122          {
123              try
124              {
125 <                SafeWaitHandle handle = new SafeWaitHandle(m_hProcess, false);
125 >                SafeWaitHandle handle = new SafeWaitHandle(m_ReadProcess.Handle, false);
126                  if (handle.IsInvalid) { return; }
127                  if (handle.IsClosed) { return; }
128                  handle.Close();
129                  handle = null;
130 <                m_hProcess = IntPtr.Zero;
130 >                //m_hProcess = IntPtr.Zero;
131                  //string stack_trace = System.Environment.StackTrace;
132                  //int iRetValue;
133                  //iRetValue = ProcessMemoryReaderApi.CloseHandle(m_hProcess);
# Line 103 | Line 153 | namespace Sojaner.MemoryScanner
153          /// </summary>
154          private class ProcessMemoryReaderApi
155          {
156 <            // constants information can be found in <winnt.h>
157 <            [Flags]
158 <            public enum ProcessAccessType
159 <            {
110 <                PROCESS_TERMINATE = (0x0001),
111 <                PROCESS_CREATE_THREAD = (0x0002),
112 <                PROCESS_SET_SESSIONID = (0x0004),
113 <                PROCESS_VM_OPERATION = (0x0008),
114 <                PROCESS_VM_READ = (0x0010),
115 <                PROCESS_VM_WRITE = (0x0020),
116 <                PROCESS_DUP_HANDLE = (0x0040),
117 <                PROCESS_CREATE_PROCESS = (0x0080),
118 <                PROCESS_SET_QUOTA = (0x0100),
119 <                PROCESS_SET_INFORMATION = (0x0200),
120 <                PROCESS_QUERY_INFORMATION = (0x0400)
121 <            }
156 >          
157 >        
158 >            [DllImport("kernel32.dll")]
159 >            public static extern int VirtualQueryEx(IntPtr hProcess, IntPtr lpAddress, out MEMORY_BASIC_INFORMATION lpBuffer, uint dwLength);
160  
161              // function declarations are found in the MSDN and in <winbase.h>
162  
# Line 254 | Line 292 | namespace Sojaner.MemoryScanner
292              return false;
293          }
294          #endregion
295 <        #region public void ReadProcessMemory(int MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data)
296 <        public void ReadProcessMemoryAtOnce(int MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data)
295 >
296 >        public void ReadProcessMemoryAtOnce(uint MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data)
297          {
298 <            ReadProcessMemoryAtOnce((uint)MemoryAddress, bytesToRead, out bytesRead, out data);
298 >            Stopwatch st = new Stopwatch();
299 >            st.Start();
300 >            uint size = 1024 * 64;
301 >            List<byte> buffer_list = new List<byte>();
302 >            for (uint j = MemoryAddress; j < bytesToRead; j += size)
303 >            {
304 >                ProcessMemoryChunk mem = new ProcessMemoryChunk(m_ReadProcess, (IntPtr)j, (int)size);
305 >                byte[] bigMem = mem.Read();
306 >                foreach (byte b in bigMem) { buffer_list.Add(b); }
307 >                bigMem = null;
308 >            }
309 >            bytesRead = buffer_list.Count;
310 >            data = new byte[bytesToRead];
311 >            data.Initialize();
312 >            Buffer.BlockCopy(buffer_list.ToArray(), 0, data, 0, (int)bytesToRead);
313 >            st.Stop();
314 >            logger.Profiler.WriteLine("ReadProcessMemoryAtOnce(): start=0x{0:x8} end=0x{1:x8} took {2:0.0000} seconds", MemoryAddress, MemoryAddress + bytesToRead, st.Elapsed.TotalSeconds);
315          }
316 +
317 +        #region public void ReadProcessMemory(int MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data)
318          public void ReadProcessMemory(int MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data)
319          {
320              ReadProcessMemory((uint)MemoryAddress, bytesToRead, out bytesRead, out data);
321          }
266        public void ReadProcessMemoryAtOnce(uint MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data)
267        {
268            try
269            {
270                data = new byte[bytesToRead];
271                //bytesRead = 0;
272                //int _bytesRead = 0;
273                //const uint alignment = 20480;
274                //uint _MemoryAddress = MemoryAddress;
275                //for (uint i = 0; i < bytesToRead;i+=alignment)
276                //{
277                //    byte[] _tmp_data = new byte[alignment];
278                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)MemoryAddress, data, bytesToRead, out bytesRead);
279                //    _MemoryAddress = MemoryAddress + i;
280                //    Buffer.BlockCopy(_tmp_data, 0, data, (int)i, _bytesRead);
281                //    bytesRead += _bytesRead;
282                //}
283            }
284            catch (SEHException ex)
285            {
286                logger.Error.WriteLine("ReadProcessMemory() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
287                logger.Error.WriteLine(ex.ToString());
288                throw ex;
289            }
290            catch (Exception ex)
291            {
292                logger.Error.WriteLine("ReadProcessMemory(): Exception");
293                logger.Error.WriteLine(ex.ToString());
294                throw ex;
295            }
296        }
322          public void ReadProcessMemory(uint MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data)
323          {
324              try
325              {
326                  bytesRead = 0;
327 <
327 >                data = new byte[bytesToRead];
328 >                const int alignment = 1;
329                  List<byte> buffer_list = new List<byte>();
330                  uint _MemoryAddress = MemoryAddress;
331                  for (int i = 0; i < bytesToRead; i++)
332                  {
333 <                    byte[] buffer = new byte[1];
333 >                    byte[] buffer = new byte[alignment];
334                      int _bytesRead = 0;
335 <                    ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)_MemoryAddress, buffer, 1, out _bytesRead);
335 >                    MEMORY_BASIC_INFORMATION m;
336 >                    ProcessMemoryReaderApi.VirtualQueryEx(m_ReadProcess.Handle, (IntPtr)_MemoryAddress, out m, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION)));
337 >
338 >                    if (m.AllocationProtect.HasFlag(AllocationProtect.PAGE_NOACCESS) ||
339 >                        m.AllocationProtect == 0)
340 >                    {
341 >                        uint OrignalAddress = _MemoryAddress;
342 >                        while (m.AllocationProtect.HasFlag(AllocationProtect.PAGE_NOACCESS) || m.AllocationProtect == 0)
343 >                        {
344 >                            ProcessMemoryReaderApi.VirtualQueryEx(m_ReadProcess.Handle, (IntPtr)_MemoryAddress, out m, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION)));
345 >                            _MemoryAddress++;
346 >                            buffer_list.Add(0);
347 >                        }
348 >                        _MemoryAddress--;
349 >                        uint diff = _MemoryAddress - OrignalAddress;
350 >                        i += (int)diff;
351 >                        buffer_list.RemoveAt(buffer_list.Count-1);
352 >                    }
353 >
354 >                    ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)_MemoryAddress, buffer, alignment, out _bytesRead);
355 >                    int LastError = Marshal.GetLastWin32Error();
356 >                    if (LastError != ResultWin32.ERROR_SUCCESS)
357 >                    {
358 >                        string ErrorName = ResultWin32.GetErrorName(LastError);
359 >                    }
360                      if (_bytesRead > 0)
361                      {
362                          foreach (byte b in buffer)
# Line 315 | Line 365 | namespace Sojaner.MemoryScanner
365                          }
366                          _MemoryAddress += (uint)buffer.Length;
367                      }
318                    else
319                    {
320                        //buffer_list.Add((byte)'?');
321                        buffer_list.Add(0);
322                        _MemoryAddress++;
323                    }
324                    
368                  }
369                  bytesRead = buffer_list.Count;
370 <                data = buffer_list.ToArray();
370 >                Buffer.BlockCopy(buffer_list.ToArray(), 0, data, 0, (int)bytesToRead);
371              }
372              catch (SEHException ex)
373              {
# Line 360 | Line 403 | namespace Sojaner.MemoryScanner
403                  {
404                      UIntPtr _ptrBytesWritten = UIntPtr.Zero;
405                      byte[] buffer = new byte[] { bytesToWrite[i] };
406 <                    ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)_MemoryAddress, buffer, (uint)buffer.Length, out _ptrBytesWritten);
406 >                    ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)_MemoryAddress, buffer, (uint)buffer.Length, out _ptrBytesWritten);
407                      _MemoryAddress++;
408                      _bytesWritten++;
409                  }
# Line 416 | Line 459 | namespace Sojaner.MemoryScanner
459                              _bytesToRead = byte_alignment;
460                              buffer = new byte[byte_alignment];
461                          }
462 <                        ReadProcessMemoryAtOnce(address, _bytesToRead, out bytesRead, out buffer);
462 >                        ReadProcessMemory(address, _bytesToRead, out bytesRead, out buffer);
463                          bw.Write(buffer);
464                          bw.Flush();
465  
# Line 466 | Line 509 | namespace Sojaner.MemoryScanner
509          {
510              byte[] bitData = BitConverter.GetBytes(value);
511              UIntPtr ptrBytesWritten;
512 <            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
512 >            ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
513              if (ptrBytesWritten.ToUInt32() == 0)
514                  return false;
515              byte check = 0;
# Line 480 | Line 523 | namespace Sojaner.MemoryScanner
523          {
524              byte[] bitData = BitConverter.GetBytes(value);
525              UIntPtr ptrBytesWritten;
526 <            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
526 >            ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
527              if (ptrBytesWritten.ToUInt32() == 0)
528                  return false;
529              sbyte check = 0;
# Line 494 | Line 537 | namespace Sojaner.MemoryScanner
537          {
538              byte[] bitData = BitConverter.GetBytes(value);
539              UIntPtr ptrBytesWritten;
540 <            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
540 >            ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
541              if (ptrBytesWritten.ToUInt32() == 0)
542                  return false;
543              ushort check = 0;
# Line 508 | Line 551 | namespace Sojaner.MemoryScanner
551          {          
552              byte[] bitData = BitConverter.GetBytes(value);
553              UIntPtr ptrBytesWritten;
554 <            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
554 >            ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
555              if (ptrBytesWritten.ToUInt32() == 0)
556                  return false;
557              short check = 0;
# Line 522 | Line 565 | namespace Sojaner.MemoryScanner
565          {
566              byte[] bitData = BitConverter.GetBytes(value);
567              UIntPtr ptrBytesWritten;
568 <            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
568 >            ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
569              if (ptrBytesWritten.ToUInt32() == 0)
570                  return false;
571              uint check = 0;
# Line 536 | Line 579 | namespace Sojaner.MemoryScanner
579          {
580              byte[] bitData = BitConverter.GetBytes(value);
581              UIntPtr ptrBytesWritten;
582 <            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
582 >            ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
583              if (ptrBytesWritten.ToUInt32() == 0)
584                  return false;
585              int check = 0;
# Line 550 | Line 593 | namespace Sojaner.MemoryScanner
593          {
594              byte[] bitData = BitConverter.GetBytes(value);
595              UIntPtr ptrBytesWritten;
596 <            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
596 >            ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
597              if (ptrBytesWritten.ToUInt32() == 0)
598                  return false;
599              ulong check = 0;
# Line 564 | Line 607 | namespace Sojaner.MemoryScanner
607          {
608              byte[] bitData = BitConverter.GetBytes(value);
609              UIntPtr ptrBytesWritten;
610 <            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
610 >            ProcessMemoryReaderApi.WriteProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, (uint)bitData.Length, out ptrBytesWritten);
611              if (ptrBytesWritten.ToUInt32() == 0)
612                  return false;
613              long check = 0;
# Line 585 | Line 628 | namespace Sojaner.MemoryScanner
628                  int bytesRead;
629                  uint size = sizeof(byte);
630                  byte[] bitData = new byte[size];
631 <                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)address, bitData, size, out bytesRead);
631 >                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, size, out bytesRead);
632                  if (bytesRead == 0)
633                      return false;
634                  value = bitData[0];
# Line 607 | Line 650 | namespace Sojaner.MemoryScanner
650                  int bytesRead;
651                  uint size = sizeof(sbyte);
652                  byte[] bitData = new byte[size];
653 <                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)address, bitData, size, out bytesRead);
653 >                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, size, out bytesRead);
654                  if (bytesRead == 0)
655                      return false;
656                  value = Convert.ToSByte(bitData[0]);
# Line 629 | Line 672 | namespace Sojaner.MemoryScanner
672                  int bytesRead;
673                  uint size = sizeof(ushort);
674                  byte[] bitData = new byte[size];
675 <                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)address, bitData, size, out bytesRead);
675 >                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, size, out bytesRead);
676                  if (bytesRead == 0)
677                      return false;
678                  value = BitConverter.ToUInt16(bitData, 0);
# Line 651 | Line 694 | namespace Sojaner.MemoryScanner
694                  int bytesRead;
695                  uint size = sizeof(short);
696                  byte[] bitData = new byte[size];
697 <                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)address, bitData, size, out bytesRead);
697 >                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, size, out bytesRead);
698                  if (bytesRead == 0)
699                      return false;
700                  value = BitConverter.ToInt16(bitData, 0);
# Line 673 | Line 716 | namespace Sojaner.MemoryScanner
716                  int bytesRead;
717                  uint size = sizeof(uint);
718                  byte[] bitData = new byte[size];
719 <                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)address, bitData, size, out bytesRead);
719 >                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, size, out bytesRead);
720                  if (bytesRead == 0)
721                      return false;
722                  value = BitConverter.ToUInt32(bitData, 0);
# Line 695 | Line 738 | namespace Sojaner.MemoryScanner
738                  int bytesRead;
739                  uint size = sizeof(int);
740                  byte[] bitData = new byte[size];
741 <                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)address, bitData, size, out bytesRead);
741 >                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, size, out bytesRead);
742                  if (bytesRead == 0)
743                      return false;
744                  value = BitConverter.ToInt32(bitData, 0);
# Line 717 | Line 760 | namespace Sojaner.MemoryScanner
760                  int bytesRead;
761                  uint size = sizeof(ulong);
762                  byte[] bitData = new byte[size];
763 <                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)address, bitData, size, out bytesRead);
763 >                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, size, out bytesRead);
764                  if (bytesRead == 0)
765                      return false;
766                  value = BitConverter.ToUInt64(bitData, 0);
# Line 739 | Line 782 | namespace Sojaner.MemoryScanner
782                  int bytesRead;
783                  uint size = sizeof(long);
784                  byte[] bitData = new byte[size];
785 <                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)address, bitData, size, out bytesRead);
785 >                ProcessMemoryReader.ProcessMemoryReaderApi.ReadProcessMemory(m_ReadProcess.Handle, (IntPtr)address, bitData, size, out bytesRead);
786                  if (bytesRead == 0)
787                      return false;
788                  value = BitConverter.ToInt64(bitData, 0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines