title: Read memory from process at dll in C#
body: <p>I am trying to read memory from an process in C#. I found out how to read from an specific address:</p>
  
  <pre><code>    public static byte[] ReadMemory(Process process, int address, int numOfBytes, out int bytesRead)
      {
          IntPtr hProc = OpenProcess(ProcessAccessFlags.All, false, process.Id);
          byte[] buffer = new byte[numOfBytes];
          ReadProcessMemory(hProc, new IntPtr(address), buffer, numOfBytes, out bytesRead);
          return buffer;
      }
      private int getVal(Process proc, int address)
      {
          int bytesRead;
          byte[] value = ReadMemory(proc, address, 4, out bytesRead);
          int am = BitConverter.ToInt32(value, 0);
          return am;
      }
      public void threadFunction()
      {
          Process[] processes = Process.GetProcessesByName("gta_sa");
          foreach (Process process in processes)
          {
              int ServerPointer = getVal(process, 0xB6F5F0);//Its about this line
              MessageBox.Show(ServerPointer.ToString());
          }
      }
  </code></pre>
  
  <p>but as I am looking trough the web, I keep finding this:</p>
  
  <p>But instead of 0xB6F5F0 I actually need to read address samp.dll+2071C0 (this address I found on the web)</p>
  
  <p>Does anyone know how  I can do this?</p>
  
  <p>Thanks in advance</p>