Linear Executable (LX/LE) Format

From ModdingWiki
Jump to navigation Jump to search
Linear Executable (LX/LE) Format
Format typeExecutable / Script
TypeCompiled
PlatformMS-DOS
Code16-bit (LX), 16/32bit mixed (LE)
Hidden data?Yes
GamesNone

The Linear Executable format is an executable format used by OS/2, many DOS extenders and Microsoft Windows VxD files. There are two main variants LX (16 bit only) and LE (16/32 bit mixed).

Many DOS games from the late 90s are 32-bit games shipped as LE executable together with a DOS extender. The DOS extender will boot the CPU into 32-bit protected mode, extract the actual game from the game executable, load it into memory and run it. A popular choice at the time was DOS4G(W) that can be found along many games.

History

The Linear Executable (LX/LE) Format is the direct successor of the New Executable (NE) Format. It was superseded by the Portable Executable (PE) Format.

Format Specifications

Signature

A Linear executable features a standard MZ header, with the e_lfanew field at offset 0x3C pointing to an LX/LE header instead of an NE header. The LX/LE headers have a different magic value than the NE header, namely "LX" and "LE".

See the links below for further details on the format.

Specifications

Notes

  • Many specifications are old and for the LX variant, which was not used by DOS extenders. There are some slight differences when reading LE file compared to reading LX file, like page map entries being 32bit wide for LE but 64bit wide for LX). Open watcom as linked above is a good source to see those differences
  • dos32a is an open source DOS extender which can also help with understanding the LE variant

Modding