-
January 29th, 2004, 10:19 AM
#1
source for depends.exe
Does anyone know if Microsoft ever published the source code to depends or if there are any samples out there on how to walk the dependency list for a EXE/DLL?
Sam
-
January 29th, 2004, 11:31 AM
#2
You could deassembler depends.exe and analyze the ASM code.
Kuphryn
-
January 30th, 2004, 07:20 AM
#3
You could deassembler depends.exe and analyze the ASM code.
Funny, funny
-
January 30th, 2004, 07:54 AM
#4
I'd assume. in step 1 they use the IMAGEHLP Library to find out implicit linkage information and then in step 2 hook LoadLibrary[AW] to recursively apply step (1) on the newly loaded library.
Shoudn't be too difficult - but whoever wants to compete with depends???
The Saviour of the World is a Penguin and Linus Torvalds is his Prophet.
-
January 30th, 2004, 07:57 AM
#5
Originally posted by ReorX but whoever wants to compete with depends???
Someone that is maintaining and enhancing software that has over 50 DLL's where many of those DLL's are loaded with LoadLibrary. The idea of being able to tell the user (or developer) which exact DLL is missing would be a HUGE time saver, especially when trying to get the debug code set up on the product managers machine!
-
January 30th, 2004, 09:52 AM
#6
Take a look at these articles of Matt Pietrek:
Under The Hood
An In-Depth Look into the Win32 Portable Executable File Format
Also you can search in MSDN for "Peering Inside the PE: A Tour of the Win32 Portable Executable File Format".
-
January 30th, 2004, 10:14 AM
#7
-
January 30th, 2004, 10:22 AM
#8
Originally posted by scarleton
Someone that is maintaining and enhancing software that has over 50 DLL's where many of those DLL's are loaded with LoadLibrary. The idea of being able to tell the user (or developer) which exact DLL is missing would be a HUGE time saver, especially when trying to get the debug code set up on the product managers machine!
Do you need depends.exe or something like that to do this? Why not just a simple standalone app that calls LoadLibrary on all of your DLL's and see which ones fail?
Regards,
Paul McKenzie
-
January 30th, 2004, 11:21 AM
#9
Originally posted by scarleton
Someone that is maintaining and enhancing software that has over 50 DLL's where many of those DLL's are loaded with LoadLibrary. The idea of being able to tell the user (or developer) which exact DLL is missing would be a HUGE time saver, especially when trying to get the debug code set up on the product managers machine!
Depends only tells you about implicitly loaded dll's. If you are loading dll's with LoadLibrary(), depends isn't going to help you track down which ones are missing, because it has no way of knowing about them.
For implicitly loaded dll's the OS will tell you what is missing when you run the program.
Perhaps an initialization function that checks for all the dll's that might get loaded would be good, then you could pop up an error message from within your program.
Or, use an installer to install, even on the lowly product manager's machine. Stop copying files around.
-
January 30th, 2004, 11:33 AM
#10
Originally posted by wayside
Depends only tells you about implicitly loaded dll's. If you are loading dll's with LoadLibrary(), depends isn't going to help you track down which ones are missing, because it has no way of knowing about them.
Well...no...to find out which dll's are dynamically loaded you need to use the profiling feature of the 'Dependeny Walker'.
-
January 30th, 2004, 12:30 PM
#11
Originally posted by Andreas Masur
Well...no...to find out which dll's are dynamically loaded you need to use the profiling feature of the 'Dependeny Walker'.
I think the goal is to find out which ones are missing *before* you run the program. Finding out which ones are missing as you demo the software to your boss probably isn't all that helpful.
And unless you go through every code path while you run the profiler that is going to load a library, you're not going to know for sure whether all the dll's are really there.
Profiling won't help in a customer support scenario, either, because a customer is unlikely to even have the dependancy walker.
A little tool to verify the environment that your program must run in is a very useful thing to have, and can be used by lots of people in a number of scenarios. I don't think depends is the best tool for the job here.
-
January 30th, 2004, 01:05 PM
#12
Originally posted by wayside
I don't think depends is the best tool for the job here.
Well...I agree, however, I do not know any better at the moment...
-
January 30th, 2004, 02:27 PM
#13
Well... I've been assuming he knows the total set of dlls used by his program, and he's just trying to find out which are missing. Perhaps this is bad assumption.
-
January 30th, 2004, 03:06 PM
#14
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|