Linear Executable (LX/LE) Format
Format type | Executable / Script |
---|---|
Type | Compiled |
Platform | MS-DOS |
Code | 16-bit (LX), 16/32bit mixed (LE) |
Hidden data? | Yes |
Games | None |
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
- http://fileformats.archiveteam.org/wiki/Linear_Executable
- June 3, 1992: http://www.textfiles.com/programming/FORMATS/lxexe.txt
- June 30, 1994 (Revision 8): http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/pc/os2/OS2_OMF_and_LX_Object_Formats_Revision_8_199406.pdf
- June 14, 2001 (Revision 11): https://archive.org/details/IBMOS2Warp4ToolkitDocuments2/32-bit%20Linear%20eXecutable%20Module%20Format%20%28LX%29%20Specification/
- https://github.com/open-watcom/open-watcom-v2/blob/master/bld/watcom/h/exeflat.h
- Headers from Windows: https://github.com/gameprive/win2k/blob/4abce2f1531739102d49db5c9f9e20e1e2d0de71/private/windbg64/langapi/include/exe_vxd.h
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
- Tutorial:Adding more space to Linear Executable DOS Games (Add room for new code, assets and text strings)
- Tutorial:Unbinding Games from DOS extenders with dos32a