modified paths
This commit is contained in:
parent
347d1b5b24
commit
3a226c344d
6
attach
6
attach
@ -20,16 +20,16 @@ fi
|
||||
echo Running instances: ${arr[@]}
|
||||
echo Attaching to ${arr[$1]}
|
||||
|
||||
if grep -q $(realpath libcathook.so) /proc/${arr[$1]}/maps; then
|
||||
if grep -q $(realpath bin/libcathook.so) /proc/${arr[$1]}/maps; then
|
||||
echo already loaded
|
||||
exit
|
||||
fi
|
||||
|
||||
echo loading $(realpath libcathook.so) to ${arr[$1]}
|
||||
echo loading $(realpath bin/libcathook.so) to ${arr[$1]}
|
||||
gdb -n -q -batch \
|
||||
-ex "attach ${arr[$1]}" \
|
||||
-ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \
|
||||
-ex "call \$dlopen(\"$(realpath libcathook.so)\", 1)" \
|
||||
-ex "call \$dlopen(\"$(realpath bin/libcathook.so)\", 1)" \
|
||||
-ex "call dlerror()" \
|
||||
-ex 'print (char *) $2' \
|
||||
-ex "detach" \
|
||||
|
@ -22,18 +22,18 @@ proc=${arr[$inst]}
|
||||
echo Running instances: ${arr[@]}
|
||||
echo Attaching to $proc
|
||||
|
||||
sudo ./detach $inst libcathook.so
|
||||
sudo ./detach $inst bin/libcathook.so
|
||||
|
||||
if grep -q $(realpath libcathook.so) /proc/$proc/maps; then
|
||||
if grep -q $(realpath bin/libcathook.so) /proc/$proc/maps; then
|
||||
echo already loaded
|
||||
exit
|
||||
fi
|
||||
|
||||
echo loading $(realpath libcathook.so) to $proc
|
||||
echo loading $(realpath bin/libcathook.so) to $proc
|
||||
gdb -n -q -batch \
|
||||
-ex "attach $proc" \
|
||||
-ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \
|
||||
-ex "call \$dlopen(\"$(realpath libcathook.so)\", 1)" \
|
||||
-ex "call \$dlopen(\"$(realpath bin/libcathook.so)\", 1)" \
|
||||
-ex "call dlerror()" \
|
||||
-ex 'print (char *) $2' \
|
||||
-ex "continue" \
|
||||
|
2
detach
2
detach
@ -20,7 +20,7 @@ fi
|
||||
echo Running instances: ${arr[@]}
|
||||
echo Detaching from ${arr[$1]}
|
||||
|
||||
if grep -q $(realpath libcathook.so) /proc/${arr[$1]}/maps; then
|
||||
if grep -q $(realpath bin/libcathook.so) /proc/${arr[$1]}/maps; then
|
||||
gdb -n -q -batch \
|
||||
-ex "attach ${arr[$1]}" \
|
||||
-ex "set \$dlopen = (void*(*)(char*, int)) dlopen" \
|
||||
|
Reference in New Issue
Block a user