title: Reading a process memory
body: <p>I'm trying to read the process memory  of a console program using ReadProcessMemory() API function.</p>
  
  <p><strong>Updated Code:</strong></p>
  
  <pre><code>    HWND hWnd = FindWindow(NULL, "Read Memory Window");
      DWORD ProcessId;
      ProcessId = GetProcessId(hWnd);
      GetWindowThreadProcessId(hWnd, &amp;ProcessId);
      HANDLE hProcess = OpenProcess(PROCESS_VM_READ,FALSE, ProcessId);
  
      SIZE_T NumberOfBytesRead;
      CHAR Buffer[128] = {0};
      dwAddr = 0x0012FD6C; //address of array to get
      BOOL sucess = ReadProcessMemory(hProcess, &amp;dwAddr, &amp;Buffer, 128, &amp;NumberOfBytesRead);
  </code></pre>
  
  <p>I get null and garbage values as i run the program along with program to read the array.</p>