"File Size" is the size of the file on disk, according to the file system.
"PE Size" is the value of the
SizeOfImage field in the
IMAGE_OPTIONAL_HEADER structure in the PE file. Its value is calculated as described here:
IMAGE_OPTIONAL_HEADER.SizeOfImage is the size of the loaded
executable/dll in virtual memory. It is not the same as the size on
You can calculate it with
VirtualAddress + VirtualSize of the last
IMAGE_OPTIONAL_HEADER.SizeOfImage is that value rounded up to the
IMAGE_OPTIONAL_HEADER.SectionAlignment (usually the same as
the page size).
SizeOfImage can be less than the file size if, for example, the file has an overlay appended to it.
SizeOfImage can be greater than the file size if, for example, the sections' virtual sizes are larger than their raw sizes, as is often the case for compressed sections.