DLL function address

Joined
Feb 12, 2008
Messages
108
Reaction score
0
Hello everyone,


Some study these days about address of exported function in DLL. It is appreciated if you could review and comment.

(for C++ DLL/EXE only)

1.Inside DLL

For the DLL itself, in its build process, it has to decide the address of each function in the result binary file (.dll), right? I think each exported function in the dll biinary file has a definite absolute address, which is based on the default load base address of the DLL, right?

2. Inside EXE

For the EXE, which utilizes the DLL, since there may be DLL rebase, which changes the base load address of the DLL into EXE process space, the address of the exported function of the DLL is not known until EXE load time and the final rebased address of the exported function of the DLL is put into the IAT of EXE.
In other words, the same function of the DLL, may have different address in different EXEs, which loads the DLL into related process space of EXE.
So, all the places where invokes the dllexported function, will use a function pointer to point to the IAT entry of the related dllexported function to form a indirection level function call. No address of DLL exported function is known and written to the EXE binary until load time address fix-up.

My understanding of (1) and (2) correct? Any comments?


thanks in advance,
George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top