Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 1.27 KB

ii.25-file-format-extensions-to-pe.md

File metadata and controls

11 lines (6 loc) · 1.27 KB

II.25 File format extensions to PE

This contains informative text only.

The file format for CLI components is a strict extension of the current Portable Executable (PE) File Format. This extended PE format enables the operating system to recognize runtime images, accommodates code emitted as CIL or native code, and accommodates runtime metadata as an integral part of the emitted code. There are also specifications for a subset of the full Windows PE/COFF file format, in sufficient detail that a tool or compiler can use the specifications to emit valid CLI images.

The PE format frequently uses the term RVA (Relative Virtual Address). An RVA is the address of an item once loaded into memory, with the base address of the image file subtracted from it (i.e., the offset from the base address where the file is loaded). The RVA of an item will almost always differ from its position within the file on disk. To compute the file position of an item with RVA r, search all the sections in the PE file to find the section with RVA s, length l and file position p in which the RVA lies, ie sr < s+l. The file position of the item is then given by p+(r-s).

Unless stated otherwise, all binary values are stored in little-endian format.

End informative text.