death
January 30th, 2002, 20:10
Lately I've been working on the PE file format and I noticed this weird thing.
According to Microsoft's PE documentation, the object table entry field PHYSICAL SIZE is:
PHYSICAL SIZE = DD Physical file size of initialized data. The size
of the initialized data in the file for the object. The physical
size must be a multiple of the File Align field in the PE Header, and
must be less than or equal to the Virtual Size.
Notice the last sentence. Now, let's take a Visual C++ generated executable and check its fields:
SECTION HEADER #1
.text name
5A35 virtual size
1000 virtual address
6000 size of raw data
(I used DumpBin to dump the PE information)
In this case, the Physical Size field was GREATER than the Virtual Size.
Can anyone explain?
PS. If you are wondering "How can this file be loaded then", it's because the bytes after the Virtual Size position are the alignment bytes and are not important.
According to Microsoft's PE documentation, the object table entry field PHYSICAL SIZE is:
PHYSICAL SIZE = DD Physical file size of initialized data. The size
of the initialized data in the file for the object. The physical
size must be a multiple of the File Align field in the PE Header, and
must be less than or equal to the Virtual Size.
Notice the last sentence. Now, let's take a Visual C++ generated executable and check its fields:
SECTION HEADER #1
.text name
5A35 virtual size
1000 virtual address
6000 size of raw data
(I used DumpBin to dump the PE information)
In this case, the Physical Size field was GREATER than the Virtual Size.
Can anyone explain?
PS. If you are wondering "How can this file be loaded then", it's because the bytes after the Virtual Size position are the alignment bytes and are not important.