The above is the complete list of MS-DOS header fields, but I don't know which of them are mandatory and which are optional, does anyone know?
相关问题
- jump stubs in PE files
- How do I determine the architecture of an executab
- How to programatically find the bytecode (CIL) in
- When Resources of a PE file are loaded
- Sandbox Virtual Machine for an Application (concep
相关文章
- PE Format - IAT Questions
- How can `kernel32.dll` export an ordinal of 0, whe
- Can anyone define the Windows PE Checksum Algorith
- Where can I find a reference for what every bit of
- How to convert PE(Portable Executable) format to E
- how to build an executable without import table in
- How to bind 64-bit and 32-bit executable into one?
- what is the maximum size of a PE file on 64-bit Wi
Well back in 2006 someone wanted to create the world most tiny PE. For this he wrote a small PE Fuzzer. With the smallest codebase posible.
He managed to get the following sizes of PE's you are too busy to read the entire page, here is a summary of the results:
You can check his work here: http://www.phreedom.org/research/tinype/
He also states the required header values. These are:
OptionalHeader:
If you're trying to create PE Image,
e_magic
(Magic number) andelfanew
(File address of new exe header) are the only mandatory fields that you have to fill in.elfanew
should point to the PEIMAGE_NT_HEADER
structure.For MS-DOS, all of the headers are mandatory.
For Win9x and above, e_lfanew must be the offset from the start of the image to the start of the IMAGE_NT_HEADERS, and e_magic must be IMAGE_DOS_SIGNATURE ('MZ').