3 # 1. Inject a freshly built object file into a fresh executable.
4 # Both use a dynamically loaded function.
5 # 2. Detour execution from a function in the executable to a function
6 # originating from the object file.
7 # 3. Check if the new executable prints the expected changed output.
9 source ./boilerplate.sh
11 elfucli --input $BUILDDIR/putsmainsub \
12 --reladd $BUILDDIR/puts_noarg.o \
13 --detour sub,puts_noarg \
14 --output $BUILDDIR/putsmainsub-with-puts-noarg-detour
17 $BUILDDIR/putsmainsub-with-puts-noarg-detour | grep -q "puts_noarg() is returning."