OS2.org Site Index - Feedback - Impressum
Sprachauswahl / Choose your Language News Software Hardware Projekte Forum Tipps Links Verschiedenes
Editorial Diskussion HelpDesk Umfrage
[Forum]
in nach (Erweiterte Suche)
[Forum]
( Archiv ) ( Neues Thema )

( Zeige die Threadübersicht ) ( Zur Startübersicht )
11.03.2001
Was und Wie: Die Parameter von EXEHDR.EXE (von: GA, 13:09:40) ^
Die Uitlity EXEHDR.EXE ist ein Bestandteil von VisualAge für C++. Die Datei findet man auch bei

http://www.os2bbs.com

Mit dieser Utility kann man EXE- und DLL-Datein unter OS/2 anlysieren. Die Parameter sind:

EXEHDR [options] filename

<options> Options used to modify Output or change the file header.

<filename> One or more names of applications or dynamic-link library files.

Regardless of options, EXEHDR always creates an Output listing of the file header.


To display EXEHDR help, type EXEHDR /? at the command prompt. The appropriate copyright statement appears along with a brief list of
EXEHDR options.

Usage: EXEHDR [options] filename...
Valid options are:

/?

/HEAP:(0H - ffffH)

/HELP

/MAX:(0H - ffffH)

/MIN:(0H - ffffH)

/NEWFILES

/NOLOGO

/PMTYPE:(PM | VIO | NOVIO | WINDOWAPI |
WINDOWCOMPAT | NOTWINDOWCOMPAT)
/RESETERROR

/STACKDOS:(0H - ffffH)

/STACKOS2:(0H - ffffffffH)

/VERBOSE

Note, that for OS/2 16-bit NE modules the maximum value for /STACKOS2 is FFFFh.


Usage Notes:

 Option characters are not case sensitive: /R and /r are equivalent.

 Options can be shortened to the fewest characters that uniquely identify them. The characters in brackets can be omitted: /N and /NOLOGO are equivalent.

 Although use of the minimum one-letter abbreviations is allowed, if a future release has an additional option starting with the same letter, the
one-letter option will no longer be usable.

 The option /STACK is deprecated, and has been replaced by /STACKDOS and /STACKOS2. Because /STACK has serious limitations and can
potentially damage an executable file, it is strongly recommended that you do not use it. Use one or both of the replacement options instead.

The EXEHDR options that can change executable files are MIN, MAX, STACKDOS, STACKOS2, PMTYPE, HEAP, RESETERROR, and NEWFILES.

Executable headers are used by the operating system to determine characteristics of the executable file, such as stack size, entry point, number of objects (or segments), and so on. EXEHDR recognizes three different kinds of executable headers: DOS (generated by DOS linker), OS/2 16-bit (generated by LINK), and OS/2 32-bit (generated by LINK386).

An X in the following table indicates which option changes which executable header:

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿOption ÿDOS ÿOS/2 16-bit ÿOS/2 32-bit ÿ
ÿ ÿ ÿ(LINK) ÿ(LINK386) ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿHEAP ÿ ÿX ÿX ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿMAX ÿX ÿ ÿ ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿMIN ÿX ÿ ÿ ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿNEWFILES ÿ ÿX ÿ ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿPMTYPE ÿ ÿX ÿX ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿRESETERROR ÿ ÿX ÿX ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿSTACKDOS ÿX ÿ ÿ ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿSTACKOS2 ÿ ÿX ÿX ÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

For compatibility purposes, executable files generated by either of the OS/2 link utilities include both a DOS header and an OS/2 header.

Display Help (/HELP or /?)

Syntax: /HEL[P] OR /?

This option displays a brief summary of EXEHDR syntax.

Set Heap Allocation (/HEAP)

Syntax: /HEA[P]:nnnn

This option sets the size of the local heap and is applicable to OS/2 applications only. The field <nnnn> contains the local heap size in bytes.

You can specify <nnnn> in decimal, octal, or hexadecimal radix using standard C language notation.

Set Maximum Allocation (/MAX)

Syntax: /MA[X]:nnnn

This option sets the maximum allocation of memory for the program. The field <nnnn> contains the maximum number of 16-byte paragraphs required to load and run the program. This value must be equal to or greater than the minimum allocation.

Compare to /MIN.

The Maximum Allocation option is equivalent to the LINK386 /CParmaxalloc option.

Refer to Set Max Allocation Space (/CP) (in LINK386 Help)

You can specify <nnnn> in decimal, octal, or hexadecimal radix using standard C language notation.

Set Minimum Allocation (/MIN)

Syntax: /MI[N]:nnnn

This option sets the minimum allocation of memory for the program. The field <nnnn> contains the minimum number of 16-byte paragraphs required to load and run the program. This value must be equal to or less than the maximum allocation.

Compare to /MAX.

You can specify <nnnn> in decimal, octal, or hexadecimal radix using standard C language notation.

New Files (/NEWFILES)

Syntax: /NE[WFILES]

This option enables long file name support for OS/2 16-bit LINK files. OS/2 32-bit LINK386 files have long file name support.

Suppress Sign-On Banner (/NOLOGO)

Syntax: /NO[LOGO]

This option suppresses the sign-on banner displayed by EXEHDR when it starts.

Set Application Type (/PMTYPE)

Syntax: /P[MTYPE]:type

This option specifies the type of application. It pertains only to OS/2 applications. The /PMTYPE option in EXEHDR is equivalent to either the NAME
Statement in the module-definition file or the Name Application Type (/PM) in LINK386.

A keyword in <type> is equivalent to a keyword in a NAME statement, as shown in the following list:

Field Keyword Equiv. Keyword

PM WINDOWAPI

VIO WINDOWCOMPAT

NOVIO NOTWINDOWCOMPAT

The NAME statement keyword is also accepted.

Reset LINK386 Error (/RESETERROR)

Syntax: /R[ESETERROR]

This option clears an error flag stored in OS/2 applications. The error flag is set by LINK386 when the link has unresolved external references or
duplicate symbol definitions (any LINK386 error messages starting with L2xxx).

OS/2 does not load the application if the error flag is set. This option allows you to attempt to run a program with LINK386 errors and is useful
during application development.

Set DOS Stack Allocation (/STACKDOS)

Syntax: /STACKDOS:nnnn

This option sets the size of the stack in the DOS header. The field nnnn contains the stack size in bytes. This option is equivalent to the Control
Stack Size (/ST) (in LINK). DOS modules have a maximum stack size of 65,535.

Almost all OS/2 applications have a DOS header and DOS stub. The DOS stub normally is found in 3 forms. First, the LINK386 default stub. This simply prints an error message and exits the DOS program. It will say something like "Can only be run from Presentation Manager".

The second common stub type is a FAPI (Family API) program. This allow the applications to be run equally from a real DOS machine, an OS/2 or Windows DOS box, or from an OS/2 protected mode session.

Most of the OS/2 system utilities are written with FAPI. Third stub type is independant DOS and OS/2
binary images in one single application. The DOS .exe is included in the OS/2 STUB statement of the LINK386 .def file.

You can specify nnnn in decimal, hexadecimal, or octal radix using standard C language notation. For instance, a DOS stack size of 4,096 bytes can be expressed as any of the following:

 /STACKDOS:4096

 /STACKDOS:0x1000

 /STACKDOS:010000

Compare to /STACKOS2.

DO NOT USE /STACK

There is an old EXEHDR option /STACK that performed a function similar to /STACKDOS and /STACKOS2 combined.

The old /STACK option has serious limitations and potentially dangerous side effects. It it very strongly recommended that you do not use /STACK, and start using /STACKDOS and /STACKOS2 instead.

For an old DOS only application, the /STACK option should work just fine. For a 32-bit OS/2 application, the old /STACK will change only the DOS stub stack header, not the OS/2 header.

For a 16-bit OS/2 application, the old /STACK option will attempt to change both the DOS stub and OS/2 header stack values to the same nnnn value. This is potentially disasterous.

The DOS stub and OS/2 headers are sometimes
independant of each other. Attempts to change one might have disasterous results in the other.

Since there are 2 stacks in 2 different headers in the
same application there needs to be 2 different options: /STACKDOS and /STACKOS2.

Set OS/2 Stack Allocation (/STACKOS2)

Syntax: /STACKOS2:nnnn

This option sets the size of the stack in the OS/2 header. The field nnnn contains the stack size in bytes. This option is equivalent to the Control
Stack Size (/ST) (in LINK386 Help).

OS/2 16-bit NE modules have a maximum stack size of 65,535. OS/2 32-bit LX modules have a maximum stack size of 4,294,967,295.

The /STACKOS2 only changes the OS/2 header and has no effect on the DOS stub in the same module.

You can specify nnnn in decimal, hexadecimal, or octal radix using standard C language notation. For instance, an OS/2 stack size of 32,768 bytes can be expressed as any of the following:

 /STACKOS2:32768

 /STACKOS2:0x8000

 /STACKOS2:0100000

Compare to /STACKDOS.

DO NOT USE /STACK

There is an old EXEHDR option /STACK that performed a function similar to /STACKDOS and /STACKOS2 combined.

The old /STACK option has serious limitations and potentially dangerous side effects. It it strongly recommended that you no longer use /STACK, and start using /STACKDOS and /STACKOS2 instead.

For an old DOS only application, the /STACK option should work just fine. For a 32-bit OS/2 application, the old /STACK will change only the DOS stub stack header, not the OS/2 header.

For a 16-bit OS/2 application, the old /STACK option will attempt to change both the DOS stub and OS/2 header stack values to the same nnnn value. This is potentially disasterous.

The DOS stub and OS/2 headers are sometimes independant of each other. Attempts to change one might have disasterous results in the other.

Since there are 2 stacks in 2 different headers in the
same application there needs to be 2 different options: /STACKDOS and /STACKOS2.

Display in Verbose Mode (/VERBOSE)

Syntax: /V[ERBOSE]

This option displays the executable-file header in verbose mode.


EXEHDR lists the current contents of the file header and information about each object (or segment) in the file. To redirect this output to a printer or
disk file, use the operating system redirection operator.

The output is in two parts: a Header Listing giving the contents of the file header; and an Object or Segment Listing giving attributes of all objects
(or segments) in the file. If the /VERBOSE option is specified, additional output is generated.

Zum Punkt "Object or Segment Listing":


The object listing is comprised of the following fields:

no. ...:Object index number, starting with 1, in decimal

type....:Identification of the object as a code or data object

A code object is comprised of segments with class name ending in CODE. All other objects are data objects.

address...:Location, within the file, of the contents of the object (in hexadecimal)

file...:Size of the object (in bytes), as contained in the file (in hexadecimal)

mem...:Size of the object (in bytes), as it is stored in memory (in hexadecimal)

If the value of this field is greater than the value of <file>, the operating system pads the additional space with zero values at load time.

flags...:Object attributes

If the /VERBOSE option is not used, only non-default attributes are listed. Attributes are given in the form specified in the module-definition file.


The header listing is comprised of the following fields:

<Module> Name of Application

This field lists the name of the application as specified in the NAME statement of the module-definition file.

If no module definition was used to create the executable file, this field displays the name assumed by default.

If a module definition was used to create the file, but the LIBRARY statement appeared instead of the NAME statement (thus specifying a dynamic-link library), the name of the library is given and EXEHDR uses the word "Library" instead of "Module" to identify the field.

<Description> Description of Application

This field gives the contents, if any, of the DESCRIPTION statement of the module-definition file used to create the file being examined.

<Data> Type of Automatic Data Object

This field indicates the type of automatic data segment in a program: SHARED, NONSHARED, or NONE.

This type can be specified in a module-definition file. The defaults are NONSHARED for applications and SHARED for dynamic-link libraries.

<Initial CS:IP> Program Starting Address

This field gives the program starting address (if an application is being examined) or address of the initialization routine (if a dynamic-link library
is being examined).

<Initial SS:SP> Initial Stack Pointer

This field gives the value of the initial stack pointer.

<Extra Stack Allocation> Additional stack allocation

This field gives the value of the extra stack location.

<DGROUP> Automatic-Data-Object Number


The following output is generated by EXEHDR for the executable file LINK386.EXE:

Module: LINK386

Description: Operating System/2 32-bit LX Linker

Data: NONSHARED

Initial CS:IP: seg 2 offset 6c78

Initial SS:SP: seg 4 offset 0000

Extra stack allocation: 4000 bytes

DGROUP: seg 4

no. type address file mem flags

1 CODE 00006000 0f7d6 0f7d7
2 CODE 00015a00 08e40 08e40
3 DATA 0001ea00 02865 02865
4 DATA 00021400 02337 08bd0


When you specify the /VERBOSE option, EXEHDR generates additional output:

 DOS-specific header information. All OS/2 executable files have a DOS header, whether bound or not.

If the program is not bound, the DOS portion typically consists of a stub that simply terminates the program.

 OS/2-specific header information. The object-table display in verbose mode is described below.

 File addresses and lengths of the various tables in the executable file. For each table, the following is generated:

- Name of the table
- Address of the table within the file
- Length of the table in hexadecimal radix
- Length of the table in decimal radix

 Object table with complete attributes, not just the non-default attributes. The /VERBOSE option displays two additional attributes:

- The RELOCS attribute is displayed for each object that has address relocations. Relocations occur in each object that references objects in
other objects or makes dynamic-link references.

- The ITERATED attribute is displayed for each object that has iterated data. Iterated data consist of a special code that packs repeated bytes.

 Run-time relocations and fixups.

 All exported entry points.

[ Leser: 89 ]

19.03.2001
Re: Was und Wie: Die Parameter von EXEHDR.EXE (von: Christian Hennecke, 01:36:39)
Hallo Gerhard!

Was hältst Du davon, Beiträge dieser Art auch gleich in die "Tipps"-Kategorie einzutragen?

Das könnte man so halten... (von: GA, 12:39:04)
Ich habe nur die Vermutung, daß solche umfangreichen Dartsellunegn einige Betrachter dort nicht vermuten und ungehalten reagieren. Unter Tips verstehe ich kuze Hinweise, nicht längere Anweisungen.

Dabeu gehe ich von internationalen Maßstäben aus.

( Zeige die Threadübersicht ) [ Version zum Drucken ] ( Zur Startübersicht )

Datum Thema
07.01.2017 *

*

Name: * eMail: Benachrichtigung

Mit * markierte Felder müssen ausgefüllt werden !


php.net OpenIT © 1998-2017 by WebTeam OS2.org