Skip to content

Commit

Permalink
clean up findgadget data, fix preload bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rorymcnamara committed Jul 13, 2017
1 parent 8e671d7 commit 890357c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 890357c

Please sign in to comment.