afl-cov icon indicating copy to clipboard operation
afl-cov copied to clipboard

Difficulty of Using afl-cov on Mac OS -- lacking readelf

Open zhoulaifu opened this issue 5 years ago • 3 comments

I am using afl-cov on Mac OS. It seems that afl-cov depends on readelf, which does not exist on Mac. What would you suggest to deal with this?

$ afl-cov -d ./out --coverage-cmd "cat AFL_FILE | ./a.out" -c .
[*] Need a valid path to readelf, use --readelf-path

zhoulaifu avatar Oct 01 '19 13:10 zhoulaifu

I was able to get afl-cov working on mac os a while ago. Make sure to specify the --disable-gcov-check Argument to your command. You may run into future issues down the line, so reference my other comment if you run into other issues: https://github.com/mrash/afl-cov/issues/31#issuecomment-402208352

hullalex-tek avatar Oct 02 '19 17:10 hullalex-tek

Thanks. I may misunderstand the command line usage, but it is not working with --disable-gcov-check.

$ ~/Downloads/afl-cov/afl-cov --disable-gcov-check ./a.out -d out/ --coverage-cmd "cat AFL_FILE | ./a.out" -c .
[*] Need a valid path to readelf, use --readelf-path

Above, ./a.out refers to the binary compiled from the source code, out is the directory where afl dumps its results.

zhoulaifu avatar Oct 07 '19 09:10 zhoulaifu

Try manually specifying the path to lcov and genthml. If I remember correctly, the default locations are different for linux and macOS.

hullalex-tek avatar Oct 07 '19 14:10 hullalex-tek