about summary refs log tree commit diff
path: root/frida_mode/util
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-08-30 20:37:12 +0000
committerGitHub <noreply@github.com>2023-08-30 20:37:12 +0000
commit5020e6b275adf0d74e9174b278ff417b5c6a64d2 (patch)
treebdc52ef01f7c7d05931054118cef48e97161783b /frida_mode/util
parentc60431247e971881bc159a84e5505dfec7adcf6d (diff)
parente4b408932d50c278f3dcd1612a44647512218a6f (diff)
downloadafl++-5020e6b275adf0d74e9174b278ff417b5c6a64d2.tar.gz
Merge pull request #1826 from WorksButNotTested/arm64-fix
Don't corrupt instruction if map offset is too large
Diffstat (limited to 'frida_mode/util')
-rwxr-xr-xfrida_mode/util/frida_get_symbol_addr.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/frida_mode/util/frida_get_symbol_addr.sh b/frida_mode/util/frida_get_symbol_addr.sh
index fb0002b7..2e682255 100755
--- a/frida_mode/util/frida_get_symbol_addr.sh
+++ b/frida_mode/util/frida_get_symbol_addr.sh
@@ -31,12 +31,13 @@ file=$(file $target|sed 's/.*: //')
 arch=$(echo $file|awk -F, '{print$2}'|tr -d ' ')
 bits=$(echo $file|sed 's/-bit .*//'|sed 's/.* //')
 pie=$(echo $file|grep -wqi pie && echo pie)
+dso=$(echo $file|grep -wqi "shared object" && echo dso)
 
 test $(uname -s) = "Darwin" && symbol=_"$symbol"
 tmp_addr=$(nm "$target" | grep -i "T $symbol" | awk '{print$1}' | tr a-f A-F)
 
 test -z "$tmp_addr" && { echo Error: function $symbol not found 1>&2; exit 1; }
-test -z "$pie" && { echo 0x$tmp_addr; exit 0; }
+test -z "$pie" && test -z "$dso" && { echo 0x$tmp_addr; exit 0; }
 
 test -z "$base" && {
   test "$bits" = 32 -o "$bits" = 64 || { echo "Error: could not identify arch (bits=$bits)" 1>&2 ; exit 1; }