From 890357ceb40c4674f09cd5195e5f27b0ff00457d Mon Sep 17 00:00:00 2001 From: Rory McNamara Date: Thu, 13 Jul 2017 14:43:50 +0100 Subject: [PATCH] clean up findgadget data, fix preload bug --- utils.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils.sh b/utils.sh index f27da5d..454c21b 100644 --- a/utils.sh +++ b/utils.sh @@ -95,8 +95,7 @@ findgadget() { matches=() match=() - eval grep -Fao --byte-offset "$1" ${LIBS[@]} | grep -o "^[^:]*:[^:]*" | IFS=$'\n' read -a matches - for match in ${matches[@]}; do + eval grep -Fao --byte-offset "$1" ${LIBS[@]} | grep -o "^[^:]*:[^:]*" | while IFS=$'\n' read match; do IFS=: match=(${match}) getsect "${match[0]}" ".text" ${PROGBITS} | IFS=' ' read textaddr textsize @@ -110,7 +109,7 @@ findgadget() { if [[ -z "${match[0]}" || -z "${match[1]}" ]]; then matches=() match=() - eval grep -Fao --byte-offset "$1" /usr/lib/* 2>/dev/null | grep -o "^[^:]*:[^:]*" | while read match; do + eval grep -Fao --byte-offset "$1" /usr/lib/* 2>/dev/null | grep -o "^[^:]*:[^:]*" | while IFS=$'\n' read match; do IFS=: match=(${match}) getsect "${match[0]}" ".text" ${PROGBITS} | IFS=' ' read textaddr textsize