title: convert memory address to int
body: <p>I am trying to read memory addresses from an executable running in memory, and then use those memory addresses to walk the PE structure.</p>
  
  <p>I am having trouble because I'm unsure how to convert a 4 byte char array to it's int equivalent.</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>char buffer[4];
  int e_lfanew = 60;
  
  if(!ReadProcessMemory(pHandle, (me32.modBaseAddr + e_lfanew), buffer, 4, NULL))
  {
      printf("ReadProcessMemory @ %x Failed (%d)\n", me32.modBaseAddr, GetLastError());
  }
  </code></pre>
  
  <p>The address i'm reading in, in this case 0xE0000000, is the offset of the PE Header.  I want to take the memory address I just read and use it as an offset to read from process memory again, but I cannot figure out how to convert it to an int properly.</p>
  
  <p>Any help would be greatly appreciated.</p>