#!/bin/bash
if [ $# != 2 ] ; then
echo "USAGE: 查找指定目录下函数符号所在的Mach-O文件"
echo " e.g.: $0 目录名 要查找的函数符号"
exit 1;
fi
find $1 > "./allFileName"
while IFS='' read -r line || [[ -n "$line" ]]; do
file $line | awk '{if(match($0, /Mach-O/)) {split($0, array, ":"); print array[1] >> "./libFileName"}}'
done < "./allFileName"
while IFS='' read -r line || [[ -n "$line" ]]; do
echo $line
nm $line | grep $2
done < "./libFileName"
if [ $# != 2 ] ; then
echo "USAGE: 查找指定目录下函数符号所在的Mach-O文件"
echo " e.g.: $0 目录名 要查找的函数符号"
exit 1;
fi
find $1 > "./allFileName"
while IFS='' read -r line || [[ -n "$line" ]]; do
file $line | awk '{if(match($0, /Mach-O/)) {split($0, array, ":"); print array[1] >> "./libFileName"}}'
done < "./allFileName"
while IFS='' read -r line || [[ -n "$line" ]]; do
echo $line
nm $line | grep $2
done < "./libFileName"