title: What's the difference between PAGE_EXECUTE and PAGE_EXECUTE_READ?
body: <p>Windows provides 2 different <a href="https://msdn.microsoft.com/en-us/library/aa366786(v=VS.85).aspx" rel="noreferrer">memory protection constants</a> (e.g. for <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa366898(v=vs.85).aspx" rel="noreferrer">VirtualProtect</a>'s third param) that seem to behave similarly: <code>PAGE_EXECUTE</code> and <code>PAGE_EXECUTE_READ</code>.</p>
  
  <p>It would seem <code>PAGE_EXECUTE</code> should be execute-only rights (without read). However, execute rights without read doesn't make much sense, since the CPU needs to read the instructions from the memory before it can decode and execute them. In addition, I read <a href="http://www.kernelmode.info/forum/viewtopic.php?f=10&amp;t=4195" rel="noreferrer">here</a> that indeed <code>PAGE_EXECUTE</code> memory also allows reading from it.</p>
  
  <p>So.. Why are there two different constants, what's the difference between them? Why should I prefer one over the other?</p>