Created
July 9, 2015 06:17
-
-
Save yurial/97c5acd31b7d7cb87e5b to your computer and use it in GitHub Desktop.
libfunc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
$(readelf -V $1 |sed -n "/.gnu.version_r.*/,/#/p" | while read LINE; do | |
echo $LINE |grep -q 'File: '; | |
if [ $? -eq 0 ]; then | |
CURLIB=`echo $LINE |egrep -o "([a-zA-Z0-9\.]+?\.so(\.[a-zA-Z0-9\.]+?)?)"`; | |
else | |
echo $LINE |grep -q 'Version: '; | |
if [ $? -eq 0 ]; then | |
VER=`echo $LINE |egrep -o "Version: [0-9]+" |egrep -o "[0-9]+"`; | |
echo "export LIB$VER=$CURLIB"; | |
fi; | |
fi; | |
done;) | |
readelf -s $1 |egrep -o "[_a-zA-Z0-9]+@[\._A-Z0-9]+ \([0-9]+\)" |awk -F"@| |[(]|[)]" '{system("printf \"%30s %-16s %s\\n\" "$1" "$2" $LIB"$4)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment