Is it possible to run a larger than 4GB .exe?
I created a >4GB SFX archive (the self extracting archives) in 7-Zip, without warning. When the recipient tried to extract it, he got this error ribbon:
I found it's because the .exe
is larger than 4GB. After installing 7-Zip he was able to extract the archive, but I am wondering why can't Windows run such an executable? And is it possible to via some override?
Solution 1:
Windows won't support executables greater than 4GB in size according to this thread:
http://sourceforge.net/p/sevenzip/discussion/45798/thread/337fc13e/
The commenter "Igor Pavlov" is the creator and the maintainer of 7-Zip. While that comment is somewhat curt, there are other threads on the sourceforge forums which repeat the same advice. I don't believe running the executable on a 64-bit OS would make any difference as this may well be a limitation of the size of a windows executable file, i.e. a limitation of the Windows PE format itself.
This article on Writing 64-bit programs suggests that:
The executable "image" (the code/data as loaded in memory) of a Win64 file is limited in size to 2GB. This is because the AMD64/EM64T processors use relative addressing for most instructions, and the relative address is kept in a dword. A dword is only capable of holding a relative value of ±2GB.
Presumably Igor has come up with a way of using ±2GB to achieve 4GB.