Is the data section divided into process memory
Yes. It is unlikely to survive for a very long time, the program can write to this section. Which launches a copy of the copy page to write, which receives the page supported by the page file, not the PE file.
how can a process get a section offset?
The compiler has already calculated the variable offsets in the section. It can be moved, distributed to DLLs with an inconvenient base address, which is already used when loading DLLs. In this case, the relocation table in the PE file is used by the loader to correct the addresses in the code. Pages containing such corrected code receive the same access to the data section, they are no longer supported by the PE file and cannot be shared between processes.
Is there any way to get the process entry point
The entire PE file goes into memory, including its headers. Therefore, you can read IMAGE_OPTIONAL_HEADER.AddressOfEntryPoint from memory without reading the file. Keep in mind that it hurts if you do it for another process, since you do not have direct access to its virtual address space. You should use ReadProcessMemory (), which is pretty little fun and is unlikely to be faster than reading a file. The file is most likely present in the file system cache. The function of randomizing the layout of the address space can give you a headache designed to make it difficult.
source share