  Executable-File Header Format (3.1)
 ίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίί
An executable (.EXE) file for the Windows operating system contains a
combination of code and data or a combination of code, data, and resources.
The executable file also contains two headers: an MS-DOS header and a
Windows header. The next two sections describe these headers; the third
section describes the code and data contained in a Windows executable file.

 MS-DOS Header
 ίίίίίίίίίίίίί
The MS-DOS (old-style) executable-file header contains four distinct parts:
a collection of header information (such as the signature word, the file
size, and so on), a reserved section, a pointer to a Windows header (if one
exists), and a stub program.

If the word value at offset 18h is 40h or greater, the word value at 3Ch is
typically an offset to a Windows header. Applications must verify this for
each executable-file header being tested, because a few applications have a
different header style.

MS-DOS uses the stub program to display a message if Windows has not been
loaded when the user attempts to run a program.

 Windows Header
 ίίίίίίίίίίίίίί
The Windows (new-style) executable-file header contains information that the
loader requires for segmented executable files. This information includes
the linker version number, data specified by the linker, data specified by
the resource compiler, tables of segment data, tables of resource data, and
so on. The following illustration shows the Windows executable-file header:

The following sections describe the entries in the Windows executable-file
header.

 Information Block
 ίίίίίίίίίίίίίίίίί
The information block in the Windows header contains the linker version
number, the lengths of various tables that further describe the executable
file, the offsets from the beginning of the header to the beginning of these
tables, the heap and stack sizes, and so on. The following list summarizes
the contents of the header information block (the locations are relative to
the beginning of the block):

 Location ³ Description
 ΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
  00h     ³ Specifies the signature word. The low byte contains "N" (4Eh)
          ³ and the high byte contains "E" (45h).
          ³
  02h     ³ Specifies the linker version number.
          ³
  03h     ³ Specifies the linker revision number.
          ³
  04h     ³ Specifies the offset to the entry table (relative to the
          ³ beginning of the header).
          ³
  06h     ³ Specifies the length of the entry table, in bytes.
          ³
  08h     ³ Reserved.
          ³
  0Ch     ³ Specifies flags that describe the contents of the executable
          ³ file. This value can be one or more of the following bits:
          ³
          ³ Bit ³ Meaning
          ³ ΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
          ³  0  ³ The linker sets this bit if the executable-file format is
          ³     ³ SINGLEDATA. An executable file with this format contains
          ³     ³ one data segment. This bit is set if the file is a
          ³     ³ dynamic-link library (DLL).
          ³     ³
          ³  1  ³ The linker sets this bit if the executable-file format is
          ³     ³ MULTIPLEDATA. An executable file with this format
          ³     ³ contains multiple data segments. This bit is set if the
          ³     ³ file is a Windows application.
          ³     ³
          ³     ³ If neither bit 0 nor bit 1 is set, the executable-file
          ³     ³ format is NOAUTODATA. An executable file with this format
          ³     ³ does not contain an automatic data segment.
          ³     ³
          ³  2  ³ Reserved.
          ³     ³
          ³  3  ³ Reserved.
          ³     ³
          ³  8  ³ Reserved.
          ³     ³
          ³  9  ³ Reserved.
          ³     ³
          ³ 11  ³ If this bit is set, the first segment in the executable
          ³     ³ file contains code that loads the application.
          ³     ³
          ³ 13  ³ If this bit is set, the linker detects errors at link
          ³     ³ time but still creates an executable file.
          ³     ³
          ³ 14  ³ Reserved.
          ³     ³
          ³ 15  ³ If this bit is set, the executable file is a library module.
          ³     ³
          ³     ³ If bit 15 is set, the CS:IP registers point to an
          ³     ³ initialization procedure called with the value in the AX
          ³     ³ register equal to the module handle. The initialization
          ³     ³ procedure must execute a far return to the caller. If the
          ³     ³ procedure is successful, the value in AX is nonzero.
          ³     ³ Otherwise, the value in AX is zero.
          ³     ³
          ³     ³ The value in the DS register is set to the library's data
          ³     ³ segment if SINGLEDATA is set. Otherwise, DS is set to the
          ³     ³ data segment of the application that loads the library.
          ³
  0Eh     ³ Specifies the automatic data segment number. (0Eh is zero if the
          ³ SINGLEDATA and MULTIPLEDATA bits are cleared.)
          ³
  10h     ³ Specifies the initial size, in bytes, of the local heap. This
          ³ value is zero if there is no local allocation.
          ³
  12h     ³ Specifies the initial size, in bytes, of the stack. This value
          ³ is zero if the SS register value does not equal the DS register
          ³ value.
          ³
  14h     ³ Specifies the segment:offset value of CS:IP.
          ³
  18h     ³ Specifies the segment:offset value of SS:SP.
          ³
          ³ The value specified in SS is an index to the module's segment
          ³ table. The first entry in the segment table corresponds to
          ³ segment number 1.
          ³
          ³ If SS addresses the automatic data segment and SP is zero, SP
          ³ is set to the address obtained by adding the size of the
          ³ automatic data segment to the size of the stack.
          ³
  1Ch     ³ Specifies the number of entries in the segment table.
          ³
  1Eh     ³ Specifies the number of entries in the module-reference table.
          ³
  20h     ³ Specifies the number of bytes in the nonresident-name table.
          ³
  22h     ³ Specifies a relative offset from the beginning of the Windows
          ³ header to the beginning of the segment table.
          ³
  24h     ³ Specifies a relative offset from the beginning of the Windows
          ³ header to the beginning of the resource table.
          ³
  26h     ³ Specifies a relative offset from the beginning of the Windows
          ³ header to the beginning of the resident-name table.
          ³
  28h     ³ Specifies a relative offset from the beginning of the Windows
          ³ header to the beginning of the module-reference table.
          ³
  2Ah     ³ Specifies a relative offset from the beginning of the Windows
          ³ header to the beginning of the imported-name table.
          ³
  2Ch     ³ Specifies a relative offset from the beginning of the file to
          ³ the beginning of the nonresident-name table.
          ³
  30h     ³ Specifies the number of movable entry points.
          ³
  32h     ³ Specifies a shift count that is used to align the logical
          ³ sector. This count is log2 of the segment sector size. It is
          ³ typically 4, although the default count is 9. (This value
          ³ corresponds to the /alignment [/a] linker switch. When the
          ³ linker command line contains /a:16, the shift count is 4.
          ³
          ³ When the linker command line contains /a:512, the shift count is
          ³ 9.)
          ³
  34h     ³ Specifies the number of resource segments.
          ³
  36h     ³ Specifies the target operating system, depending on which bits
          ³ are set:
          ³
          ³ Bit ³ Meaning
          ³ ΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
          ³  0  ³ Operating system format is unknown.
          ³     ³
          ³  1  ³ Reserved.
          ³     ³
          ³  2  ³ Operating system is Microsoft Windows.
          ³     ³
          ³  3  ³ Reserved.
          ³     ³
          ³  4  ³ Reserved.
          ³     ³
  37h     ³ Specifies additional information about the executable file. It
          ³ can be one or more of the following values:
          ³
          ³ Bit ³ Meaning
          ³ ΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
          ³  1  ³ If this bit is set, the executable file contains a
          ³     ³ Windows 2.x application that runs in version 3.x
          ³     ³ protected mode.
          ³     ³
          ³  2  ³ If this bit is set, the executable file contains a
          ³     ³ Windows 2.x application that supports proportional fonts.
          ³     ³
          ³  3  ³ If this bit is set, the executable file contains a
          ³     ³ fast-load area.
          ³
  38h     ³ Specifies the offset, in sectors, to the beginning of the
          ³ fast-load area. (Only Windows uses this value.)
          ³
  3Ah     ³ Specifies the length, in sectors, of the fast-load area. (Only
          ³ Windows uses this value.)
          ³
  3Ch     ³ Reserved.
          ³
  3Eh     ³ Specifies the expected version number for Windows. (Only
          ³ Windows uses this value.)

 Segment Table
 ίίίίίίίίίίίίί
The segment table contains information that describes each segment in an
executable file. This information includes the segment length, segment type,
and segment-relocation data. The following list summarizes the values found
in the segment table (the locations are relative to the beginning of each
entry):

 Location ³ Description
 ΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
  00h     ³ Specifies the offset, in sectors, to the segment data (relative
          ³ to the beginning of the file). A value of zero means no data
          ³ exists.
          ³
  02h     ³ Specifies the length, in bytes, of the segment, in the file. A
          ³ value of zero indicates that the segment length is 64K, unless
          ³ the selector offset is also zero.
          ³
  04h     ³ Specifies flags that describe the contents of the executable
          ³ file. This value can be one or more of the following:
          ³
          ³ Bit ³ Meaning
          ³ ΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
          ³  0  ³ If this bit is set, the segment is a data segment.
          ³     ³ Otherwise, the segment is a code segment.
          ³     ³
          ³  1  ³ If this bit is set, the loader has allocated memory for
          ³     ³ the segment.
          ³     ³
          ³  2  ³ If this bit is set, the segment is loaded.
          ³     ³
          ³  3  ³ Reserved.
          ³     ³
          ³  4  ³ If this bit is set, the segment type is MOVABLE.
          ³     ³ Otherwise, the segment type is FIXED.
          ³     ³
          ³  5  ³ If this bit is set, the segment type is PURE or
          ³     ³ SHAREABLE. Otherwise, the segment type is IMPURE or
          ³     ³ NONSHAREABLE.
          ³     ³
          ³  6  ³ If this bit is set, the segment type is PRELOAD.
          ³     ³ Otherwise, the segment type is LOADONCALL.
          ³     ³
          ³  7  ³ If this bit is set and the segment is a code segment, the
          ³     ³ segment type is EXECUTEONLY. If this bit is set and the
          ³     ³ segment is a data segment, the segment type is READONLY.
          ³     ³
          ³  8  ³ If this bit is set, the segment contains relocation data.
          ³     ³
          ³  9  ³ Reserved.
          ³     ³
          ³ 10  ³ Reserved.
          ³     ³
          ³ 11  ³ Reserved.
          ³     ³
          ³ 12  ³ If this bit is set, the segment is discardable.
          ³     ³
          ³ 13  ³ Reserved.
          ³     ³
          ³ 14  ³ Reserved.
          ³     ³
          ³ 15  ³ Reserved.
          ³
  06h     ³ Specifies the minimum allocation size of the segment, in bytes.
          ³ A value of zero indicates that the minimum allocation size is
          ³ 64K.

 Resource Table
 ίίίίίίίίίίίίίί
The resource table describes and identifies the location of each resource in
the executable file. The table has the following form:


 WORD     rscAlignShift;
 TYPEINFO rscTypes[];
 WORD     rscEndTypes;
 BYTE     rscResourceNames[];
 BYTE     rscEndNames;


Following are the members in the resource table:

 rscAlignShift    ³ Specifies the alignment shift count for resource data.
                  ³ When the shift count is used as an exponent of 2, the
                  ³ resulting value specifies the factor, in bytes, for
                  ³ computing the location of a resource in the executable
                  ³ file.
                  ³
 rscTypes         ³ Specifies an array of TYPEINFO structures containing
                  ³ information about resource types. There must be one
                  ³ TYPEINFO structure for each type of resource in the
                  ³ executable file.
                  ³
 rscEndTypes      ³ Specifies the end of the resource type definitions. This
                  ³ member must be zero.
                  ³
 rscResourceNames ³ Specifies the names (if any) associated with the
                  ³ resources in this table. Each name is stored as
                  ³ consecutive bytes; the first byte specifies the number
                  ³ of characters in the name.
                  ³
 rscEndNames      ³ Specifies the end of the resource names and the end of
                  ³ the resource table. This member must be zero.

 Type Information
 ίίίίίίίίίίίίίίίί
The TYPEINFO structure has the following form:


 typedef struct _TYPEINFO {
     WORD        rtTypeID;
     WORD        rtResourceCount;
     DWORD       rtReserved;
     NAMEINFO    rtNameInfo[];
 } TYPEINFO;


Following are the members in the TYPEINFO structure:

 rtTypeID         ³ Specifies the type identifier of the resource. This
                  ³ integer value is either a resource-type value or an
                  ³ offset to a resource-type name. If the high bit in this
                  ³ member is set (0x8000), the value is one of the
                  ³ following resource-type values:
                  ³
                  ³ Value           ³ Resource type
                  ³ ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
                  ³ RT_ACCELERATOR  ³ Accelerator table
                  ³                 ³
                  ³ RT_BITMAP       ³ Bitmap
                  ³                 ³
                  ³ RT_CURSOR       ³ Cursor
                  ³                 ³
                  ³ RT_DIALOG       ³ Dialog box
                  ³                 ³
                  ³ RT_FONT         ³ Font component
                  ³                 ³
                  ³ RT_FONTDIR      ³ Font directory
                  ³                 ³
                  ³ RT_GROUP_CURSOR ³ Cursor directory
                  ³                 ³
                  ³ RT_GROUP_ICON   ³ Icon directory
                  ³                 ³
                  ³ RT_ICON         ³ Icon
                  ³                 ³
                  ³ RT_MENU         ³ Menu
                  ³                 ³
                  ³ RT_RCDATA       ³ Resource data
                  ³                 ³
                  ³ RT_STRING       ³ String table
                  ³
                  ³ If the high bit of the value in this member is not set,
                  ³ the value represents an offset, in bytes relative to
                  ³ the beginning of the resource table, to a name in the
                  ³ rscResourceNames member.
                  ³
rtResourceCount   ³ Specifies the number of resources of this type in the
                  ³ executable file.
                  ³
rtReserved        ³ Reserved.
                  ³
rtNameInfo        ³ Specifies an array of NAMEINFO structures containing
                  ³ information about individual resources. The
                  ³ rtResourceCount member specifies the number of
                  ³ structures in the array.

 Name Information
 ίίίίίίίίίίίίίίίί
The NAMEINFO structure has the following form:


 typedef struct _NAMEINFO {
     WORD rnOffset;
     WORD rnLength;
     WORD rnFlags;
     WORD rnID;
     WORD rnHandle;
     WORD rnUsage;
 } NAMEINFO;


Following are the members in the NAMEINFO structure:

 rnOffset ³ Specifies an offset to the contents of the resource data
          ³ (relative to the beginning of the file). The offset is in terms
          ³ of alignment units specified by the rscAlignShift member at
          ³ the beginning of the resource table.
          ³
 rnLength ³ Specifies the resource length, in bytes.
          ³
 rnFlags  ³ Specifies whether the resource is fixed, preloaded, or shareable.
          ³ This member can be one or more of the following values:
          ³
          ³ Value  ³ Meaning
          ³ ΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
          ³ 0x0010 ³ Resource is movable (MOVEABLE). Otherwise, it is fixed.
          ³        ³
          ³ 0x0020 ³ Resource can be shared (PURE).
          ³        ³
          ³ 0x0040 ³ Resource is preloaded (PRELOAD). Otherwise, it is
          ³        ³ loaded on demand.
          ³
 rnID     ³ Specifies or points to the resource identifier. If the
          ³ identifier is an integer, the high bit is set (8000h).
          ³ Otherwise, it is an offset to a resource string, relative to
          ³ the beginning of the resource table.
          ³
 rnHandle ³ Reserved.
          ³
 rnUsage  ³ Reserved.

 Resident-Name Table
 ίίίίίίίίίίίίίίίίίίί
The resident-name table contains strings that identify exported functions in
the executable file. As the name implies, these strings are resident in
system memory and are never discarded. The resident-name strings are
case-sensitive and are not null-terminated. The following list summarizes
the values found in the resident-name table (the locations are relative to
the beginning of each entry):

 Location  ³ Description
 ΝΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
   00h     ³ Specifies the length of a string. If there are no more strings
           ³ in the table, this value is zero.
           ³
 01h - xxh ³ Specifies the resident-name text. This string is case-sensitive
           ³ and is not null-terminated.
           ³
 xxh + 01h ³ Specifies an ordinal number that identifies the string. This
           ³ number is an index into the entry table.

The first string in the resident-name table is the module name.

 Module-Reference Table
 ίίίίίίίίίίίίίίίίίίίίίί
The module-reference table contains offsets for module names stored in the
imported-name table. Each entry in this table is 2 bytes long.

 Imported-Name Table
 ίίίίίίίίίίίίίίίίίίί
The imported-name table contains the names of modules that the executable
file imports. Each entry contains two parts: a single byte that specifies
the length of the string and the string itself. The strings in this table
are not null-terminated.

 Entry Table
 ίίίίίίίίίίί
The entry table contains bundles of entry points from the executable file
(the linker generates each bundle). The numbering system for these ordinal
values is 1-based--that is, the ordinal value corresponding to the first
entry point is 1.

The linker generates the densest possible bundles under the restriction that
it cannot reorder the entry points. This restriction is necessary because
other executable files may refer to entry points within a given bundle by
their ordinal values.

The entry-table data is organized by bundle, each of which begins with a
2-byte header. The first byte of the header specifies the number of entries
in the bundle (a value of 00h designates the end of the table). The second
byte specifies whether the corresponding segment is movable or fixed. If the
value in this byte is 0FFh, the segment is movable.

If the value in this byte is 0FEh, the entry does not refer to a segment
but refers, instead, to a constant defined within the module. If the value
in this byte is neither 0FFh nor 0FEh, it is a segment index.

For movable segments, each entry consists of 6 bytes and has the following
form:

 Location ³ Description
 ΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
  00h     ³ Specifies a byte value. This value can be a combination of the
          ³ following bits:
          ³
          ³ Bit(s) ³ Meaning
          ³ ΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
          ³   0    ³ If this bit is set, the entry is exported.
          ³        ³
          ³   1    ³ If this bit is set, the segment uses a global (shared)
          ³        ³ data segment.
          ³        ³
          ³  3-7   ³ If the executable file contains code that performs
          ³        ³ ring transitions, these bits specify the number of
          ³        ³ words that compose the stack. At the time of the ring
          ³        ³ transition, these words must be copied from one ring
          ³        ³ to the other.
          ³
  01h     ³ Specifies an int 3fh instruction.
          ³
  03h     ³ Specifies the segment number.
          ³
  04h     ³ Specifies the segment offset.

For fixed segments, each entry consists of 3 bytes and has the following
form:

 Location ³ Description
 ΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
  00h     ³ Specifies a byte value. This value can be a combination of the
          ³ following bits:
          ³
          ³ Bit(s) ³ Meaning
          ³ ΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
          ³  0     ³ If this bit is set, the entry is exported.
          ³        ³
          ³  1     ³ If this bit is set, the entry uses a global (shared)
          ³        ³ data segment. (This may be set only for SINGLEDATA
          ³        ³ library modules.)
          ³        ³
          ³ 3-7    ³ If the executable file contains code that performs
          ³        ³ ring transitions, these bits specify the number of
          ³        ³ words that compose the stack. At the time of the ring
          ³        ³ transition, these words must be copied from one ring
          ³        ³ to the other.
          ³
  01h     ³ Specifies an offset.

 Nonresident-Name Table
 ίίίίίίίίίίίίίίίίίίίίίί
The nonresident-name table contains strings that identify exported functions
in the executable file. As the name implies, these strings are not always
resident in system memory and are discardable. The nonresident-name strings
are case-sensitive; they are not null-terminated. The following list
summarizes the values found in the nonresident-name table (the specified
locations are relative to the beginning of each entry):

 Location  ³ Description
 ΝΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
  00h      ³ Specifies the length, in bytes, of a string. If this byte is
           ³ 00h, there are no more strings in the table.
           ³
 01h - xxh ³ Specifies the nonresident-name text. This string is
           ³ case-sensitive and is not null-terminated.
           ³
 xx + 01h  ³ Specifies an ordinal number that is an index to the entry
           ³ table.

The first name that appears in the nonresident-name table is the module
description string (which was specified in the module-definition file).

 Code Segments and Relocation Data
 ίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίί
Code and data segments follow the Windows header. Some of the code segments
may contain calls to functions in other segments and may, therefore, require
relocation data to resolve those references. This relocation data is stored
in a relocation table that appears immediately after the code or data in the
segment.

The first 2 bytes in this table specify the number of relocation
items the table contains. A relocation item is a collection of bytes
specifying the following information:

 ώ Address type (segment only, offset only, segment and offset)
 ώ Relocation type (internal reference, imported ordinal, imported name)
 ώ Segment number or ordinal identifier (for internal references)
 ώ Reference-table index or function ordinal number (for imported ordinals)
 ώ Reference-table index or name-table offset (for imported names)

Each relocation item contains 8 bytes of data, the first byte of which
specifies one of the following relocation-address types:

 Value ³ Meaning
 ΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
   0   ³ Low byte at the specified offset
       ³
   2   ³ 16-bit selector
       ³
   3   ³ 32-bit pointer
       ³
   5   ³ 16-bit offset
       ³
  11   ³ 48-bit pointer
       ³
  13   ³ 32-bit offset

The second byte specifies one of the following relocation types:

 Value ³ Meaning
 ΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
   0   ³ Internal reference
       ³
   1   ³ Imported ordinal
       ³
   2   ³ Imported name
       ³
   3   ³ OSFIXUP

The third and fourth bytes specify the offset of the relocation item within
the segment.

If the relocation type is imported ordinal, the fifth and sixth bytes
specify an index to a module's reference table and the seventh and eighth
bytes specify a function ordinal value.

If the relocation type is imported name, the fifth and sixth bytes specify
an index to a module's reference table and the seventh and eighth bytes
specify an offset to an imported-name table.

If the relocation type is internal reference and the segment is fixed, the
fifth byte specifies the segment number, the sixth byte is zero, and the
seventh and eighth bytes specify an offset to the segment. If the relocation
type is internal reference and the segment is movable, the fifth byte
specifies 0FFh, the sixth byte is zero; and the seventh and eighth bytes
specify an ordinal value found in the segment's entry table.


Offset 339B3B - keyword Execute-lpDoc
  Execute (OLE 1.x)
 ίίίίίίίίίίίίίίίίίίί
 Declaration:
  OLESTATUS Execute(lpDoc, hCommands)
  LPOLESERVERDOC lpDoc;
  HGLOBAL hCommands;

The Execute function receives WM_DDE_EXECUTE commands sent by client
applications. The applications send these commands by calling the
OleExecute function.

 Parameter ³ Description
 ΝΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
 lpDoc     ³ Points to an OLESERVERDOC structure to which the dynamic data
           ³ exchange (DDE) commands apply.
           ³
 hCommands ³ Identifies memory containing one or more DDE execute commands.

 Returns:
The return value is OLE_OK if the function is successful. Otherwise, it is
an error value.

 Comments:
The server should never free the handle specified in the hCommands
parameter.



Offset 33C06E - keyword Execute-lpServer
  Execute (OLE 1.x)
 ίίίίίίίίίίίίίίίίίίί
 Declaration:
  OLESTATUS Execute(lpServer, hCommands)
  LPOLESERVER lpServer;
  HGLOBAL hCommands;

The Execute function receives WM_DDE_EXECUTE commands sent by client
applications. The applications send these commands by calling the
OleExecute function.

 Parameter ³ Description
 ΝΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
 lpServer  ³ Points to an OLESERVER structure identifying the server.
 hCommands ³ Identifies memory containing one or more dynamic data exchange
           ³ (DDE) execute commands.

 Returns:
The return value is OLE_OK if the function is successful. Otherwise, it is
an error value.

 Comments:
The server should never free the handle specified in the hCommands
parameter.


Offset 2A35E1 - keyword EXETYPE-Module-Definition
  EXETYPE Module Definition Statement
 ίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίίί
EXETYPE Module-Definition Statement EXETYPE headertype

The EXETYPE statement specifies the default executable-file (.EXE) header
type. The statement is required for every Windows application.

 Parameter  ³ Description
 ΝΝΝΝΝΝΝΝΝΝΝΨΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
 headertype ³ Specifies the header type. When linking an application
            ³ intended for the Windows environment, set this parameter to
            ³ the value "WINDOWS".
