First post, by Noctumus
I don't know if this issue has been posted on the forum before, if it's even a bug, or if it's something you actually care about, but I thought I would at least make you aware of it.
If you create a DOS EXE file containing only the MZ header (that is, a file without any executable code) like the following (which, at least in my own opinion is in fact a valid EXE file), DOSBox crashes.
4D 5A 40 00 01 00 00 00 04 00 00 00 FF FF 00 00 MZ@.............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 ................
e_magic : 0x4D5A // file id ("MZ")
e_cblp : 0x0040 // bytes on the last page in the file
e_cp : 0x0001 // total number of pages in the file
e_crlc : 0x0000 // number of relocations
e_cparhdr : 0x0004 // size of header, in paragraphs
e_minalloc : 0x0000 // minimum number of extra paragraphs needed
e_maxalloc : 0xFFFF // maximum number of extra paragraphs needed
e_ss : 0x0000 // initial value of stack segment register (SS)
e_sp : 0x0000 // initial value of stack pointer register (SP)
e_csum : 0x0000 // checksum
e_ip : 0x0000 // initial value of instruction pointer register (IP)
e_cs : 0x0000 // initial value of code segment register (CS)
e_lfarlc : 0x0000 // file address of relocation table
e_ovno : 0x0000 // overlay number (0x0000 = root)
e_res1_01 : 0x0000 // reserved
e_res1_02 : 0x0000 // reserved
e_res1_03 : 0x0000 // reserved
e_res1_04 : 0x0000 // reserved
e_oemid : 0x0000 // oem id
e_oeminfo : 0x0000 // oem info
e_res2_01 : 0x0000 // reserved
e_res2_02 : 0x0000 // reserved
e_res2_03 : 0x0000 // reserved
e_res2_04 : 0x0000 // reserved
e_res2_05 : 0x0000 // reserved
e_res2_06 : 0x0000 // reserved
e_res2_07 : 0x0000 // reserved
e_res2_08 : 0x0000 // reserved
e_res2_09 : 0x0000 // reserved
e_res2_10 : 0x0000 // reserved
e_lfanew : 0x00000040 // file offset to PE header
I've experimented with different values in the header fields, but it seems to crash no matter what when the total file size (in this case simply the value of 'e_cblp' since there's only one page in the file) is the same as the size of the header (e_cparhdr*16).