Created
July 5, 2022 20:25
-
-
Save Kethen/752338ce6b260d00a673cac97095bc70 to your computer and use it in GitHub Desktop.
symbol prober
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
# probes for suitable libraries for certain symbols in an elf | |
# for inspecting android propietary elf blobs | |
target=$1 | |
library_path=$2 | |
readelf -W -s "$target" | grep 0000000000000000 | awk '{print $8}' | while read -r LINE | |
do | |
if [ -n "$LINE" ] | |
then | |
echo "===${LINE}===" | |
for lib in "$library_path"/*.so | |
do | |
res=$(readelf -s $lib | grep -E " ${LINE}\$" | grep -v 0000000000000000) | |
if [ -n "$res" ] | |
then | |
echo $lib | |
echo $res | |
fi | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment