aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rwxr-xr-xidentify4
2 files changed, 7 insertions, 2 deletions
diff --git a/README.md b/README.md
index a6bbb8f..3f0371e 100644
--- a/README.md
+++ b/README.md
@@ -35,3 +35,8 @@ to dump.
offset_dup2 = 0x000db590
offset_recv = 0x000ed2d0
offset_str_bin_sh = 0x160a24
+
+Check whether a library is already in the database.
+
+ $ ./identify /usr/lib/libc.so.6
+ id local-f706181f06104ef6c7008c066290ea47aa4a82c5
diff --git a/identify b/identify
index 1547261..2e96fd9 100755
--- a/identify
+++ b/identify
@@ -4,5 +4,5 @@ if [[ $# != 1 ]]; then
exit 2
fi
libc=$1
-sha1=`sha1sum $libc`
-sha1sum db/*.so | grep `echo $sha1 | awk '{print $1 }'`
+sha1=`sha1sum $libc | awk '{print $1}'`
+sha1sum db/*.so | grep "$sha1 " | perl -n -e '/db\/(.*)\.so/&&print "id $1\n"'