"Relative virtual addresses" in relation to what?

I just read about the offsets of the instructions that they are in the file on disk, RVA and VA after loading them into memory. I also read that if the PE file was loaded into memory exactly the same as on disk, the RVA would be the same as the file offsets (and that would be very unusual for that).

My doubt is, under normal circumstances, what are these RVAs? The beginning of this particular PE data structure?

Edit: by PE data structure, I mean: PE header, DOS header, DOS stub, PE file header, optional image header, partition table and data directories.

+6
source share
1 answer

RVA is the address relative to the base address of the image after loading into memory.

MS PE / COFF specification says:

Relative virtual address . In the image file, the address of the element after it is loaded into memory with the base address of the image file subtracted from it. The RVA of an element almost always differs from its position in the file on disk (file pointer).

+10
source

Source: https://habr.com/ru/post/899784/


All Articles