Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding DLLs required of a Win exe on Linux (cross-compiled with mingw)?

I'm using MinGW on Linux to cross-compile to Windows. Getting that working was a breeze. Packing it up with the required DLLs was not quite as simple though. The solution at the moment is to run the executable on Windows and copy over DLLs until it actually runs.

Is there a tool for Linux that lists the DLLs required by my Windows .exe? (Something like a combination of ldd and DependencyWalker.)

like image 316
Magnus Avatar asked Jul 28 '12 17:07

Magnus


1 Answers

As of Late 2015 there are no toolchain utilities that support listing dynamic dependencies for windows binaries (such as ldd or otool).

From my tests, a complete dependency list can usually be seen with something like:

strings MY.EXE | grep -i '\.dll$'

Hackish, but it has always worked for me.

For a complete example, try this script I use in my cross environment on linux.

like image 193
h0tw1r3 Avatar answered Sep 27 '22 23:09

h0tw1r3