Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies of a dependency #14

Open
chatchoi opened this issue Sep 10, 2024 · 8 comments
Open

dependencies of a dependency #14

chatchoi opened this issue Sep 10, 2024 · 8 comments

Comments

@chatchoi
Copy link

It seems listpedeps can't handle dependencies of a dependency properly. ldd can list every dynamic libraries required for the program to run. I don't care about if it actually tries to execute the program to get the list of dependencies or not. This is what the ldd utility on Unix does and I don't think it's a problem.

Originally posted by @chatchoi in skeeto/w64devkit#168 (comment)

@brechtsanders
Copy link
Owner

This may need to be a different utility.

It's also important to prevent issues with mutually dependent libraries, as this may cause an infinite loop.

@chatchoi
Copy link
Author

This may need to be a different utility.

Why do you believe so? Dependency Walker (and the modern Dependencies written in .NET) both support this. I'm really curious about the reliability your copypedeps tool. If listpedeps can't handle the dependencies, then how copypedeps correctly copy all of the needed dependencies?

@brechtsanders
Copy link
Owner

Can you please explain why you doubt the reliability?

It does filter out dependency DLLs part of Windows so copypedeps won't copy things that are part of the OS. Maybe that's what makes yous see differences?

@brechtsanders
Copy link
Owner

@chatchoi Could you give me some example files for which listpedeps can't handle dependencies of a dependency properly?

@chatchoi
Copy link
Author

You should have MSYS2 already. Install the mingw-w64-ucrt-x86_64-geany package. You can compare the result of ldd and listpedeps on /ucrt64/bin/geany.exe.

@brechtsanders
Copy link
Owner

This is what I get:

$ listpedeps -s $(which geany.exe)
[D:/Prog/winlibs-gcc13.2.0-posix-msvcrt-11.0.1/custombuilt64/bin/geany.exe]
architecture: x86_64
machine name: AMD AMD64 (x64)
machine bits: 64-bit
subsystem:    Windows GUI
DLL:          no
stripped:     yes
file version: 0.0
minimum OS:   Windows version 5.2
image base address:  0x140000000
IMPORTS
libgeany-0.dll
KERNEL32.dll
msvcrt.dll

and it matches DependancyWalker:
image

So I believe you are asking for a -r flag to list dependancies recursively.

Would this recursive list need to be a tree then, or a sequential list with unique dependencies?

@chatchoi
Copy link
Author

chatchoi commented Sep 15, 2024

The last time I used Dependency Walker or Dependencies is very long ago. So my memory could be faded. I recall that they can display all of the dependencies. Btw, this is the result of ldd.

$ ldd /ucrt64/bin/geany
        ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ffec8f70000)
        KERNEL32.DLL => /c/Windows/system32/KERNEL32.DLL (0x7ffec70b0000)
        KERNELBASE.dll => /c/Windows/system32/KERNELBASE.dll (0x7ffec6480000)
        libgeany-0.dll => /ucrt64/bin/libgeany-0.dll (0x7ffeaee90000)
        msvcrt.dll => /c/Windows/system32/msvcrt.dll (0x7ffec7690000)
        libatk-1.0-0.dll => /ucrt64/bin/libatk-1.0-0.dll (0x7ffeaf9b0000)
        libcairo-2.dll => /ucrt64/bin/libcairo-2.dll (0x7ffeaed60000)
        comdlg32.dll => /c/Windows/system32/comdlg32.dll (0x7ffec6840000)
        libgcc_s_seh-1.dll => /ucrt64/bin/libgcc_s_seh-1.dll (0x7ffeaed30000)
        libgdk-3-0.dll => /ucrt64/bin/libgdk-3-0.dll (0x7ffeaebe0000)
        libgdk_pixbuf-2.0-0.dll => /ucrt64/bin/libgdk_pixbuf-2.0-0.dll (0x7ffeaeba0000)
        libgio-2.0-0.dll => /ucrt64/bin/libgio-2.0-0.dll (0x7ffe9c790000)
        libglib-2.0-0.dll => /ucrt64/bin/libglib-2.0-0.dll (0x7ffe9c620000)
        libgmodule-2.0-0.dll => /ucrt64/bin/libgmodule-2.0-0.dll (0x7ffeaf9a0000)
        libgobject-2.0-0.dll => /ucrt64/bin/libgobject-2.0-0.dll (0x7ffe9c5c0000)
        libgtk-3-0.dll => /ucrt64/bin/libgtk-3-0.dll (0x7ffe9aab0000)
        libiconv-2.dll => /ucrt64/bin/libiconv-2.dll (0x7ffe9a990000)
        libintl-8.dll => /ucrt64/bin/libintl-8.dll (0x7ffeaeb70000)
        ole32.dll => /c/Windows/system32/ole32.dll (0x7ffec74f0000)
        libpango-1.0-0.dll => /ucrt64/bin/libpango-1.0-0.dll (0x7ffe9c550000)
        libpangocairo-1.0-0.dll => /ucrt64/bin/libpangocairo-1.0-0.dll (0x7ffe9c530000)
        libwinpthread-1.dll => /ucrt64/bin/libwinpthread-1.dll (0x7ffe9c510000)
        SHELL32.dll => /c/Windows/system32/SHELL32.dll (0x7ffec7910000)
        libstdc++-6.dll => /ucrt64/bin/libstdc++-6.dll (0x7ffe9a760000)
        USER32.dll => /c/Windows/system32/USER32.dll (0x7ffec6ed0000)
        WSOCK32.dll => /c/Windows/SYSTEM32/WSOCK32.dll (0x7ffeaeb60000)
        GDI32.dll => /c/Windows/system32/GDI32.dll (0x7ffec6c60000)
        MSIMG32.dll => /c/Windows/SYSTEM32/MSIMG32.dll (0x7ffec1690000)
        libfontconfig-1.dll => /ucrt64/bin/libfontconfig-1.dll (0x7ffe9a700000)
        libfreetype-6.dll => /ucrt64/bin/libfreetype-6.dll (0x7ffe9a630000)
        libpixman-1-0.dll => /ucrt64/bin/libpixman-1-0.dll (0x7ffe9a580000)
        libpng16-16.dll => /ucrt64/bin/libpng16-16.dll (0x7ffe9a530000)
        zlib1.dll => /ucrt64/bin/zlib1.dll (0x7ffe9a500000)
        SHLWAPI.dll => /c/Windows/system32/SHLWAPI.dll (0x7ffec8e30000)
        COMCTL32.dll => /c/Windows/WinSxS/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.9600.17415_none_34aa3313958e7a52/COMCTL32.dll (0x7ffe9a450000)
        ADVAPI32.dll => /c/Windows/system32/ADVAPI32.dll (0x7ffec6900000)
        dwmapi.dll => /c/Windows/SYSTEM32/dwmapi.dll (0x7ffec4210000)
        HID.DLL => /c/Windows/SYSTEM32/HID.DLL (0x7ffec5280000)
        IMM32.dll => /c/Windows/system32/IMM32.dll (0x7ffec6dc0000)
        SETUPAPI.dll => /c/Windows/system32/SETUPAPI.dll (0x7ffec6a10000)
        WINMM.dll => /c/Windows/SYSTEM32/WINMM.dll (0x7ffebbbd0000)
        libcairo-gobject-2.dll => /ucrt64/bin/libcairo-gobject-2.dll (0x7ffe9a430000)
        libepoxy-0.dll => /ucrt64/bin/libepoxy-0.dll (0x7ffe9a280000)
        libfribidi-0.dll => /ucrt64/bin/libfribidi-0.dll (0x7ffe9a250000)
        libpangowin32-1.0-0.dll => /ucrt64/bin/libpangowin32-1.0-0.dll (0x7ffe9a230000)
        gdiplus.dll => /c/Windows/WinSxS/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.17415_none_932b3b5547500489/gdiplus.dll (0x7ffeb4ce0000)
        DNSAPI.dll => /c/Windows/SYSTEM32/DNSAPI.dll (0x7ffec56d0000)
        IPHLPAPI.DLL => /c/Windows/SYSTEM32/IPHLPAPI.DLL (0x7ffec1460000)
        WS2_32.dll => /c/Windows/system32/WS2_32.dll (0x7ffec6bf0000)
        libpcre2-8-0.dll => /ucrt64/bin/libpcre2-8-0.dll (0x7ffe9a1c0000)
        libffi-8.dll => /ucrt64/bin/libffi-8.dll (0x7ffe9c500000)
        COMCTL32.dll => /c/Windows/WinSxS/amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17415_none_6240486fecbd8abb/COMCTL32.dll (0x7ffec3810000)
        WINSPOOL.DRV => /c/Windows/SYSTEM32/WINSPOOL.DRV (0x7ffeb5030000)
        libharfbuzz-0.dll => /ucrt64/bin/libharfbuzz-0.dll (0x7ffe9a080000)
        combase.dll => /c/Windows/SYSTEM32/combase.dll (0x7ffec6620000)
        RPCRT4.dll => /c/Windows/system32/RPCRT4.dll (0x7ffec71f0000)
        sechost.dll => /c/Windows/SYSTEM32/sechost.dll (0x7ffec7050000)
        libthai-0.dll => /ucrt64/bin/libthai-0.dll (0x7ffe9a060000)
        libpangoft2-1.0-0.dll => /ucrt64/bin/libpangoft2-1.0-0.dll (0x7ffe9a040000)
        libexpat-1.dll => /ucrt64/bin/libexpat-1.dll (0x7ffe9a000000)
        libbz2-1.dll => /ucrt64/bin/libbz2-1.dll (0x7ffe99fe0000)
        libbrotlidec.dll => /ucrt64/bin/libbrotlidec.dll (0x7ffe99fc0000)
        MSCTF.dll => /c/Windows/system32/MSCTF.dll (0x7ffec77b0000)
        CFGMGR32.dll => /c/Windows/system32/CFGMGR32.dll (0x7ffec65a0000)
        WINMMBASE.dll => /c/Windows/SYSTEM32/WINMMBASE.dll (0x7ffebbba0000)
        DWrite.dll => /c/Windows/SYSTEM32/DWrite.dll (0x7ffec1980000)
        NSI.dll => /c/Windows/system32/NSI.dll (0x7ffec6c50000)
        WINNSI.DLL => /c/Windows/SYSTEM32/WINNSI.DLL (0x7ffec1450000)
        USP10.dll => /c/Windows/SYSTEM32/USP10.dll (0x7ffebdf20000)
        libgraphite2.dll => /ucrt64/bin/libgraphite2.dll (0x7ffe99f90000)
        libdatrie-1.dll => /ucrt64/bin/libdatrie-1.dll (0x7ffe99f80000)
        libbrotlicommon.dll => /ucrt64/bin/libbrotlicommon.dll (0x7ffe99f50000)
        SHCORE.DLL => /c/Windows/SYSTEM32/SHCORE.DLL (0x7ffec4410000)
        DEVOBJ.dll => /c/Windows/SYSTEM32/DEVOBJ.dll (0x7ffec4ec0000)

@chatchoi
Copy link
Author

chatchoi commented Sep 15, 2024

So I believe you are asking for a -r flag to list dependancies recursively.

Would this recursive list need to be a tree then, or a sequential list with unique dependencies?

Yes. I prefer the output style of ldd, which is a sequential list with unique dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants