winapi - Executable sections marked as "execute" AND "read"? -


I have seen (at least on Win32) that "read" access in the code segment (.text) in execution Are there any appropriate valid reasons for the Reading code instead of the executed bit set, as well as the "execution" access bit?

(Specifically, I am talking about it.)

IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ is mapped to memory as PAGE_EXECUTE_READ , which is equivalent to PAGE_EXECUTE_WRITECOPY This copy is required to enable on-written access per-on-write means Is that a new, process-private copy of the page is being made in any attempt to modify the outcome of the page.

There are a few different reasons for the need to write:

  • The code that needs to be moved by the loader should be set so that the loader can fix-up . This is very common.
  • Sections with code and data in a single section will also be required for this, to modify the process global code & amp; Data in a single section can save space, and improve locality by code and code is being used on the same page.
  • The code that tries to modify itself, I believe, is quite rare.

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -