diff options
author | van Hauser <vh@thc.org> | 2019-09-16 15:17:14 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2019-09-16 15:17:14 +0200 |
commit | 46ac5590037af101cd17fcdc9b488cfc483523b0 (patch) | |
tree | 6deaece5cdd9d1b84c2f98314be638fc35f5a9fd /llvm_mode | |
parent | caba176c874b0dcab3cc3f905613b85484948580 (diff) | |
download | AFLplusplus-46ac5590037af101cd17fcdc9b488cfc483523b0.tar.gz |
man page for afl-clang-fast
Diffstat (limited to 'llvm_mode')
-rw-r--r-- | llvm_mode/Makefile | 25 | ||||
-rw-r--r-- | llvm_mode/afl-clang-fast.c | 25 |
2 files changed, 37 insertions, 13 deletions
diff --git a/llvm_mode/Makefile b/llvm_mode/Makefile index 6332b01a..823b491f 100644 --- a/llvm_mode/Makefile +++ b/llvm_mode/Makefile @@ -106,7 +106,6 @@ ifeq "$(TEST_MMAP)" "1" LDFLAGS += -lrt endif - ifndef AFL_TRACE_PC PROGS = ../afl-clang-fast ../afl-llvm-pass.so ../libLLVMInsTrim.so ../afl-llvm-rt.o ../afl-llvm-rt-32.o ../afl-llvm-rt-64.o ../compare-transform-pass.so ../split-compares-pass.so ../split-switches-pass.so else @@ -118,7 +117,7 @@ ifneq "$(CLANGVER)" "$(LLVMVER)" CXX = $(shell llvm-config --bindir)/clang++ endif -all: test_shm test_deps $(PROGS) test_build all_done +all: test_shm test_deps $(PROGS) afl-clang-fast.8 test_build all_done ifeq "$(SHMAT_OK)" "1" @@ -199,6 +198,26 @@ all_done: test_build .NOTPARALLEL: clean +%.8: % + @echo .TH $* 8 `date -I` "afl++" > ../$@ + @echo .SH NAME >> ../$@ + @echo .B $* >> ../$@ + @echo >> ../$@ + @echo .SH SYNOPSIS >> ../$@ + @./$* -h 2>&1 | head -n 3 | tail -n 1 | sed 's/^\.\///' >> ../$@ + @echo >> ../$@ + @echo .SH OPTIONS >> ../$@ + @echo .nf >> ../$@ + @./$* -h 2>&1 | tail -n +4 >> ../$@ + @echo >> ../$@ + @echo .SH AUTHOR >> ../$@ + @echo "afl++ was written by Michal \"lcamtuf\" Zalewski and is maintained by Marc \"van Hauser\" Heuse <mh@mh-sec.de>, Heiko \"hexc0der\" Eissfeldt <heiko.eissfeldt@hexco.de> and Andrea Fioraldi <andreafioraldi@gmail.com>" >> ../$@ + @echo The homepage of afl++ is: https://github.com/vanhauser-thc/AFLplusplus >> ../$@ + @echo >> ../$@ + @echo .SH LICENSE >> ../$@ + @echo Apache License Version 2.0, January 2004 >> ../$@ + ln -sf afl-clang-fast.8 ../afl-clang-fast++.8 + clean: rm -f *.o *.so *~ a.out core core.[1-9][0-9]* .test2 test-instr .test-instr0 .test-instr1 - rm -f $(PROGS) ../afl-clang-fast++ + rm -f $(PROGS) ../afl-clang-fast++ ../afl-clang-fast*.8 diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index 2c25f4de..1925f5f8 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -375,20 +375,16 @@ static void edit_params(u32 argc, char** argv) { int main(int argc, char** argv) { - if (isatty(2) && !getenv("AFL_QUIET")) { + if (argc < 2 || strcmp(argv[1], "-h") == 0) { #ifdef USE_TRACE_PC - SAYF(cCYA "afl-clang-fast" VERSION cRST - " [tpcg] by <lszekeres@google.com>\n"); + printf(cCYA "afl-clang-fast" VERSION cRST + " [tpcg] by <lszekeres@google.com>\n" #else - SAYF(cCYA "afl-clang-fast" VERSION cRST " by <lszekeres@google.com>\n"); + printf(cCYA "afl-clang-fast" VERSION cRST " by <lszekeres@google.com>\n" #endif /* ^USE_TRACE_PC */ - - } - - if (argc < 2) { - - SAYF( + "\n" + "afl-clang-fast[++] [options]\n" "\n" "This is a helper application for afl-fuzz. It serves as a drop-in " "replacement\n" @@ -412,6 +408,15 @@ int main(int argc, char** argv) { exit(1); + } else if (isatty(2) && !getenv("AFL_QUIET")) { + +#ifdef USE_TRACE_PC + SAYF(cCYA "afl-clang-fast" VERSION cRST + " [tpcg] by <lszekeres@google.com>\n"); +#else + SAYF(cCYA "afl-clang-fast" VERSION cRST " by <lszekeres@google.com>\n"); +#endif /* ^USE_TRACE_PC */ + } find_obj(argv[0]); |