Use r2 -HLIBEXT in sys/apia

This commit is contained in:
pancake 2017-12-18 16:54:55 +01:00
parent 76cfc611af
commit 499cb34d8e
2 changed files with 6 additions and 4 deletions

View File

@ -1,8 +1,9 @@
#!/bin/sh
E=$(r2 -HLIBEXT)
A=r_$1
B=../../libr/$1/libr_$1.dylib
C=tmp/libr_$1.dylib
B=../../libr/$1/libr_$1.$E
C=tmp/libr_$1.$E
echo "Public"
rabin2 -qs $B | awk '{print $3}' | grep $A | sed -e 's,_r_, r_,'
@ -11,7 +12,7 @@ echo "Internal"
r2 -qcaac -c "ax~r_$1" $B | grep -v imp | sed -e 's, + ,+,g' | sed -e 's,code ,code,' | awk '{print $7" -> "$1}' | sort | sed -e 's,^, ,' | grep -v str.
echo "External"
grep $A tmp/*.i | sed -e 's,^, ,' | sed -e 's,tmp/lib,,' -e 's,.dylib.i:, -> ,'
grep $A tmp/*.i | sed -e 's,^, ,' | sed -e 's,tmp/lib,,' -e "s,.$E.i:, -> ,"
echo "Unused"
for a in `cat $C.s | grep $A` ; do

View File

@ -1,5 +1,6 @@
#!/bin/sh
LIBS=$(ls ../../libr/*/*.dylib)
EXT=$(r2 -H LIBEXT)
LIBS=$(ls ../../libr/*/*.${EXT})
mkdir tmp
for LIB in $LIBS; do
echo $LIB