aboutsummaryrefslogtreecommitdiffstats
path: root/run.sh
blob: c0d4886cc21aa9cdd6bab9f055a3e5bd05f8fc82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

if [ "$#" -ne 1 ]
then
    printf "Usage: %s <tracee_pid>\n" "$0"
    exit 1
fi

if [ ! $(cat /proc/sys/kernel/yama/ptrace_scope) -eq 0 ]
then
	echo "ptrace_scope is not set to 0 and ptrace attach will subsequently fail
	To solve this issue you can run the following command:

	echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope"
	exit 1
fi

TERM_EMU=gnome-terminal

# The syntax for the startup command may differ per terminal emulator.
make && \
${TERM_EMU} -- bash ./scripts/scan.sh "$1" && \
${TERM_EMU} -- bash ./scripts/read.sh "$1"