Is it true that PE files map directly into memory?

149 views Asked by At

Does the data of a PE file in memory mirror that of the data on disk?

1

There are 1 answers

0
Pyjong On

Well not exactly.. The minimum alignment on disk is sector, while in RAM it is one page. That may cause that the content of your sections in file is somewhat stretched in RAM. So.. curvy mirror maybe?

There are two kinds of offsets you work with when editing PEs. RVAs and RAW offsets. RVAs are offsets to your image base in RAM and RAW offsets are the same in file. In the IMAGE_SECTION_HEADER structure in winnt.h there is VirtualAddress for RVA and PointerToRawData for offset in file.

Do read this header, otherwise what's the point of this question..