Page State

The pages residing within a process’s virtual address space can be in one of 3 states:

  1. Free - The page is not accessible to the process. It is available to be reserved, committed, or simultaneously reserved and committed. Attempting to read from or write to a free page can result in an access violation exception.

  2. Reserved - The page has been reserved for future use. The range of addresses cannot be used by other allocation functions. The page is not accessible and has no physical storage associated with it. It is available to be committed.

  3. Committed - Memory charges have been allocated from the overall size of RAM and paging files on disk. The page is accessible and access is controlled by one of the memory protection constants. The system initializes and loads each committed page into physical memory only during the first attempt to read or write to that page. When the process terminates, the system releases the storage for committed pages.

Page Protection Options

Once the pages are committed, they need to have their protection option set. The list of memory protection constants can be found here but some examples are listed below.

  • PAGE_NOACCESS
  • PAGE_READONLY
  • PAGE_EXECUTE_READWRITE - Enables Read, Write and Execute. This is highly discouraged from being used and is generally an IoC because it’s uncommon for memory to be both writable and executable at the same time.