"Cachaca" <Ca*****@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
Hi. Do you guys know how can I find all the DLL file names
being used by an EXE within a visual c++ program? I know
there's a tool called Dependency Walker can do this but I need
the source codes or knowing how to do it.
To do that statically, you might want to start by reading these two
(somewhat old) articles:
http://msdn.microsoft.com/msdnmag/issues/02/02/PE/ http://msdn.microsoft.com/msdnmag/issues/02/03/PE2/
The articles discuss of utility of the author, Matt Pietrek, called PEDUMP.
It dumps Win32 "portable executable" files.
I'd suggest that you look closely at the import address table (IAT) which is
where much of the import information is stored. The twist is that an
executables are linked to potentially many DLLs and they can have imports,
too.
To do that dynamically, check the docs for EnumProcessModules().
Regards,
Will