On 1/12/2016 8:12 PM, Warren Young wrote:
On Jan 12, 2016, at 12:00 PM, Ross Berteig <[email protected]>
wrote:

On Windows, the best way to check for errant DLL references is with
DEPENDS.

That’s not a standard part of Windows.  It is included in several
different development packages from Microsoft, but someone using
MinGW may be trying to avoid installing those.

There’s a third-party site that offers it for download if you’d
rather not chase down the DDK or another source for it, but I cannot
recommend it, since I don’t know who these guys are, what their
motivations are, or how well they’ve protected themselves against
distributing trojanned versions:

http://www.dependencywalker.com/

I should have pointed that site out. They are the original authors of
DEPENDS, and that is the best source of the current version. The tool
isn't open source, but it doesn't carry any silly license burdens for
download and use. I highly recommend having it in your toolbox,
especially if your primary compilers are MinGW or something similarly
non-Microsoft.

A more trustworthy source would be Microsoft itself, but that
probably means downloading dozens of megs of unrelated stuff.  (DDK,
SDK, etc.)

IIRC, there are posts at various MS developer topic blogs that point out
that the version of DEPENDS that ships with VisualStudio is out of date
compared to what is available externally.

Some of the SysInternals tools can do similar things, like listdlls:
https://technet.microsoft.com/en-us/sysinternals/bb896656

Not a bad choice. I don't know if it can do the instrumented run of a
process trick that current versions of dependency walker can, where they
insert a debug hook into the EXE, run it, and log all DLLs that got
loaded at run time. I have used that feature along with the ability to
write a report to verify that a shipment package includes all the DLLs
that are required, even when some of those are loaded dynamically.

Or, use ldd from Cygwin, as I do.

I just checked my built fossil.exe, and DEPENDS lists only the
expected system libraries (ADVAPI32.DLL, KERNEL32.DLL, MSVCRT.DLL,
WS2_32.DLL) and no unexpected DLLs.

$ ldd fossil.exe ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
(0x7ffc5a8a0000) KERNEL32.DLL =>
/cygdrive/c/WINDOWS/system32/KERNEL32.DLL (0x7ffc58300000)
KERNELBASE.dll => /cygdrive/c/WINDOWS/system32/KERNELBASE.dll
(0x7ffc57d90000)

Also not necessarily a bad choice, if you already have and need Cygwin
which is a pretty heavy-weight package.

--
Ross Berteig                               [email protected]
Cheshire Engineering Corp.           http://www.CheshireEng.com/

_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to