en:docs:tk:formats:newexe

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:docs:tk:formats:newexe [2024/10/13 14:35] prokusheven:docs:tk:formats:newexe [2026/05/14 05:21] (current) prokushev
Line 2: Line 2:
  
 New Executable (NE) file format used by set of operating system including OS/2, Windows, Multitasking MS-DOS 4 and set of DOS Extenders. It is designed to be store on disk and in-memory usage. In-disk format is same for all OSes, but In-memory usage is mostly specific for Windows systems. New Executable (NE) file format used by set of operating system including OS/2, Windows, Multitasking MS-DOS 4 and set of DOS Extenders. It is designed to be store on disk and in-memory usage. In-disk format is same for all OSes, but In-memory usage is mostly specific for Windows systems.
 +
 +===== New Executable header =====
  
 ^ Offset ^ Size ^ Name ^ Description ^ ^ Offset ^ Size ^ Name ^ Description ^
-| 00h | WORD | ne_magic | Signature word NEMAGIC |+| 00h | WORD | ne_magic | Signature word NEMAGIC (0x4E45, 'NE'|
 | On-disk |||| | On-disk ||||
 | 02h | BYTE | ne_ver | Version number of the linker | | 02h | BYTE | ne_ver | Version number of the linker |
-| 03h | BYTE| ne_rev | Revision number of the linker |+| 03h | BYTE | ne_rev | Revision number of the linker |
 | In-memory |||| | In-memory ||||
-| 02h | WORD | count | Usage count (ne_ver/ne_rev on disk) |+| 02h | WORD | count | Usage count  |
 | 04h | WORD | ne_enttab | Entry Table file offset, relative to the beginning of the segmented EXE header | | 04h | WORD | ne_enttab | Entry Table file offset, relative to the beginning of the segmented EXE header |
 | On-disk |||| | On-disk ||||
Line 44: Line 46:
 | 3Ch | WORD | ??? | minimum code swap area size | | 3Ch | WORD | ??? | minimum code swap area size |
 | 3Eh | 2 BYTEs | ??? | expected Windows version (minor version first) | | 3Eh | 2 BYTEs | ??? | expected Windows version (minor version first) |
 +
 +===== Flag word (ne_flags) =====
 +^ Bit(s) ^ Mask ^ Name ^ Description ^
 +| 0-1 | - | NOAUTODATA | No an automatic data segment |
 +| 0 | 0001h | SINGLEDATA | Per-process library data (shared DGROUP) |
 +| 1 | 0002h | MULTIPLEDATA | Per-instance library data |
 +| 11 | 0800H | FIRSTDISC(?) | First segment in the executable file contains code that loads the application |
 +| 13 | 2000h | LINKERROR | Errors detected at link time, module will not load |
 +| 15 | 8000h | LIBRARY | Module is a dynamic‑link library (DLL) |
  
 On-disk segment entry On-disk segment entry
Line 62: Line 73:
 | 08h | WORD | ns1_handle | Selector or handle (selector - 1) of segment in memory | | 08h | WORD | ns1_handle | Selector or handle (selector - 1) of segment in memory |
  
 +<code c>
 struct new_segdata { struct new_segdata {
     union {     union {
Line 75: Line 86:
     } ns_union;     } ns_union;
 }; };
 +</code>
  
 Relocation table header Relocation table header
Line 121: Line 133:
  
  
- +  * Microsoft KB: Q65122: Executable-File Header Format 
 +  * Windows SDK 3.1 (MSDN Library, September 1992)