README.md: x86-32/64 support
[centaur.git] / tests / 05-detour.test
1 #!/bin/sh
2
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.
8
9 source ./boilerplate.sh
10
11 elfucli --input $BUILDDIR/putsmainsub \
12         --reladd $BUILDDIR/puts_noarg.o \
13         --detour sub,puts_noarg \
14         --output $BUILDDIR/putsmainsub-with-puts-noarg-detour
15 test_check_retval
16
17 $BUILDDIR/putsmainsub-with-puts-noarg-detour | grep -q "puts_noarg() is returning."
18 test_check_retval