Genymobile / copydeps

Analyze and copy library dependencies of ELF binaries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Local shared objects do not work

nkindt opened this issue · comments

Apparently whenever copydeps deals with a local .so it chokes and doesn't finish.

Example:
ldd some_elf
linux-vdso.so.1 => (0x00007ffeccfe7000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f92d170c000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f92d14ef000)
./libSDL-1.2.so.0 (0x00007f92d1265000) <--------- THIS ONE
libstdc++.so.5 => /usr/lib/x86_64-linux-gnu/libstdc++.so.5 (0x00007f92d0f89000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f92d0c80000)

copydeps -d /home/nk/bin/some_elf_libs/ some_elf
Traceback (most recent call last):
File "/usr/local/bin/copydeps", line 9, in
load_entry_point('copydeps==1.0.0', 'console_scripts', 'copydeps')()
File "/usr/local/lib/python3.5/dist-packages/copydeps-1.0.0-py3.5.egg/copydeps.py", line 238, in main
File "/usr/local/lib/python3.5/dist-packages/copydeps-1.0.0-py3.5.egg/copydeps.py", line 154, in run
File "/usr/local/lib/python3.5/dist-packages/copydeps-1.0.0-py3.5.egg/copydeps.py", line 173, in _traverse_tree
KeyError: './libSDL-1.2.so.0'

It's obvious that this particular lib is already inside the elf folder but specifying a destination directory should copy every .so that is needed by the loader no matter the .so location. Further, at least working other libs till the end would be ideal behavior with a simple error summary at the end if something went wrong (i.e. this and that libs could not be copied, etc).

Thanks!

Hi,

I am trying to reproduce your bug, but I cannot generate an elf file which produces a similar ldd output, can you share a way to produce such file?

One such executable can be downloaded from https://www.fileplanet.com/141074/download/Unreal-Tournament-2004-Patch-v3369-[Linux]-

Inside the /UT2004-Patch/System/ folder is an elf file called ut2004-bin-linux-amd64 with the exact problem described above.

Can you try the code from #9?