moflow
moflow copied to clipboard
Generated binary cannot load libdyninstAPI_RT.so and libAflDyninst.so [fixed]
I followed the instructions to instrument my binary successfully, but it complained when I tried to run the program:
[zhangys@chcpu12a afl-dyninst]$ export DYNINSTAPI_RT_LIB=/home/zhangys/local/lib/libdyninstAPI_RT.so
[zhangys@chcpu12a afl-dyninst]$ ./afl-dyninst -i ../../benchmarks/binary/lavam_binary/base64 -o base64_inst
Skipping library: libAflDyninst.so
Skipping library: libAflDyninst.cpp
Instrumenting module: base64
Skipping library: ld-linux-x86-64.so.2
Skipping library: libc.so.6
Inserting init callback.
Saving the instrumented binary to base64_inst...
All done! Happy fuzzing!
[zhangys@chcpu12a afl-dyninst]$ ./base64_inst
./base64_inst: error while loading shared libraries: libdyninstAPI_RT.so: cannot open shared object file: No such file or directory
[zhangys@chcpu12a afl-dyninst]$ ./base64_inst
./base64_inst: error while loading shared libraries: libAflDyninst.so: cannot open shared object file: No such file or directory
[zhangys@chcpu12a afl-dyninst]$ ls
afl-dyninst afl-dyninst.o base64_inst libAflDyninst.so Makefile README.txt
afl-dyninst.cpp AUTHORS libAflDyninst.cpp LICENSE rand.b64
I found that, I need to:
- put
export DYNINSTAPI_RT_LIB=xxx
into~/.bashrc
- put
libAflDyninst.so
to environment variableLD_LIBRARY_PATH
, fixed the second one
export DYNINSTAPI_RT_LIB=/home/zhangys/local/lib/libdyninstAPI_RT.so
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/zhangys/fuzzing/moflow/afl-dyninst