Valence wrote:
Quote
code: a word, letter, number, or other symbol used in a code system to mark,
represent, or identify something: The code on the label shows the date of
manufacture.
Oh please. Do not bring a layman's definition of the word code into a
discussion about software development. Every profession has a vocabulary
that is unique to it. When speaking within a profession, you are
expected to understand and use that vocabulary appropriately. In the
software development community, code means machine code, not the born on
date code that you see on bottle of Budweiser.
A PE executable file consists of various segments. Some segments contain
code (ie machine code), and some contain data. The import table resides
in a data segment called idata. If you start claiming that the import
data segment contains 'code' from the import library, then you are just
going to confuse people.
You wrote this:
<quote>
The import library used to "statically" link to a dll does contain the
appropriate code to dynamically link to the dll and bind your names to it.
</quote>
Every sane developer would read that and think that you are talking
about machine code in the import library. Not letters, numbers and symbols.
Quote
So Import libraries do contain "code". That "code" by its presence and
content does exactly as I meant to say.
Import libraries do not contain commands.
Actually, import libraries do indeed contain code. Here I am using code
to mean machine instructions that an x86 CPU can process and execute.
The code is a jump to an address. However, that code only ends up in the
code segment of the executable if the DLL author is stuck in the year
1994. For most DLLs, the code in the import library is discarded, and
the linker inserts a more efficient call.
See this article by Matt Pietrek, specifically the section on importing
functions. Pietrek is a very smart guy. It is well worth it to read just
about everything he writes.
msdn.microsoft.com/msdnmag/issues/02/02/PE/
He also has a follow up article here:
msdn.microsoft.com/msdnmag/issues/02/03/PE2/default.aspx
H^2