I'd like to find all files a binary depends on (including libraries, configuration files, basically all files referenced in the binary).
I know, that you can find shared libraries with
objdump, ldd, readelf, but what about dynamically loaded libraries (
dlopen) and other files (
So far, I have a half baked solution which searches the binary for strings (filenames) (
$ strings /path/to/binary | grep lib), but I think the proper solution would be to search for system calls the binary makes (
read, write, dlopen, etc).
Unfortunately I don't have any experience with disassemblers or an idea about other methods.
Also I cannot use solutions which depend on executing the binary (strace, and fiddling around, etc), because I need to do this for a large number of binaries in bulk.
A solution which finds about 90% of all files referenced by a binary would be sufficient.
The binaries to examine are standard (Arch) Linux (multilib) binaries. I assume most of them were compiled by gcc (-O2).