I have an app i embedded another executable inside as a resource to see if the sizes will be different but they aint and using the resource editor i can see the app inside. as for my target the file size is bigger than the PE sizesee the screenshot

i once thought there something embedded inside the app but how in Delphi? as a resource i already checked.


"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 disk.

You can calculate it with VirtualAddress + VirtualSize of the last section.

IMAGE_OPTIONAL_HEADER.SizeOfImage is that value rounded up to the value of 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.