moflow icon indicating copy to clipboard operation
moflow copied to clipboard

Generated binary cannot load libdyninstAPI_RT.so and libAflDyninst.so [fixed]

Open zhangysh1995 opened this issue 5 years ago • 0 comments

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 variable LD_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

zhangysh1995 avatar Sep 12 '19 10:09 zhangysh1995