genymobile / copydeps Goto Github PK
View Code? Open in Web Editor NEWAnalyze and copy library dependencies of ELF binaries
License: Apache License 2.0
Analyze and copy library dependencies of ELF binaries
License: Apache License 2.0
It should be great to take care of potential exeptions (--destdir
not writable or not exist for exemple) and output nice cli error (instead of crash with full stacktrace) with cli error code.
You can event use a lib to help you handle that.
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!
After a quick look at the script, I have seen that it calls ldd
and readelf
which are not guaranteed to be installed (not on http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Common/LSB-Common/rcommands.html ), and I'm not sure they are on the base install of most linux distributions.
It will be good to specify in the README that they are needed.
Also, it may seems obvious but as it is a python script it can run on Windows. We should specify that it's not supposed to be run on Windows.
Suggestion : replace Linux binaries
by ELF binaries
> Injecting text input is limited to ASCII characters.
²
is ASCII 253¨
is ASCII 249£
is ASCII 156¤
is ASCII 207µ
is ASCII 230§
is ASCII 245Originally posted by @KaKi87 in Genymobile/scrcpy#650 (comment)
Hey, nice script 👍
It sould be great to organize the code to be distributed 'the python way'
https://docs.python.org/3.5/distutils/setupscript.html#installing-scripts
https://gehrcke.de/2014/02/distributing-a-python-command-line-application/
At least to put the script in a source folder and give him back his .py
file extention :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.