为什么 64 位可移植可执行文件的入口点地址只有 32 位?

Why is the entry point address of a 64 bit portable executable only 32 bits?

根据 _IMAGE_OPTIONAL_HEADER_IMAGE_OPTIONAL_HEADER64definitions,对于 PE32 和 PE64 文件格式,AddressOfEntryPoint 是 32 位 DWORD

为什么PE64文件的AddressOfEntryPoint只有32位?不应该是64位来覆盖整个虚拟地址space吗?

您 link 说的文档:

A pointer to the entry point function, relative to the image base address.

与基地址相对,这意味着图像可以位于地址space中的任何位置。

这确实间接暗示入口点与基地址的偏移量不能超过 4GB,但这不是限制。由于其他原因,PE 映像的大小不能大于 4GB。例如,SizeOfImage 是一个 DWORD,表示图像大小限制为 4GB。