Julien Lengrand-Lambert bio photo

Julien Lengrand-Lambert

French guy living in the Netherlands. IT Chapter Lead @ING during the day, CoFounder @Skyai at night.

Twitter LinkedIn Github

Find whether a Windows dll is compiled for 32 or 64 bits on Linux

This morning, I stumbled upon an unexpected problem; and found myself not knowing what to do.

I had to compile the native part of a library on Linux, based on the existing Windows dlls. Before compiling, I needed to know if the Windows dlls were compiled for 32 or 64 bits.

It is quite easy to do on Windows, with tools such as dependency walker, but on Linux!?

I knew that for native linux (.so) files, objdump would be my weapon of choice.

So I gave it a shot, and tried:

$ objdump -x my_windows.dll | head -n 15 # returns the first 15 lines of the result

And here was the result :

libxuggle-5.dll: file format pei-i386


architecture: i386, flags 0x00000133:


start address 0x6e741058

Characteristics 0x2306


line numbers stripped

32 bit words

debugging information removed


Pretty neat, huh?

I was really not expecting objdump to be so efficient even on Windows stuff.

Well done, Linux. Well done.