diff options
author | van Hauser <vh@thc.org> | 2019-07-04 11:19:18 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2019-07-04 11:19:18 +0200 |
commit | 9199967022284da0ee4d78459d8d34513540cf32 (patch) | |
tree | a7e0aff02dd8bca50c55634ca977ec2d449fca12 /llvm_mode/afl-llvm-pass.so.cc | |
parent | 04c92c84705af4c602f134ed9a63b82be5ef75c9 (diff) | |
download | afl++-9199967022284da0ee4d78459d8d34513540cf32.tar.gz |
this is the best solution IMHO
Diffstat (limited to 'llvm_mode/afl-llvm-pass.so.cc')
-rw-r--r-- | llvm_mode/afl-llvm-pass.so.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm_mode/afl-llvm-pass.so.cc b/llvm_mode/afl-llvm-pass.so.cc index 6b2232f2..176692e3 100644 --- a/llvm_mode/afl-llvm-pass.so.cc +++ b/llvm_mode/afl-llvm-pass.so.cc @@ -237,7 +237,7 @@ bool AFLCoverage::runOnModule(Module &M) { Counter->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None)); Value *Incr; - if (neverZero_counters_str == NULL || neverZero_counters_str[0] != '4') + // if (neverZero_counters_str == NULL || neverZero_counters_str[0] != '4') Incr = IRB.CreateAdd(Counter, ConstantInt::get(Int8Ty, 1)); if (neverZero_counters_str != NULL) { @@ -255,6 +255,7 @@ bool AFLCoverage::runOnModule(Module &M) { //mov ecx,edx //add cl,0x1 //adc dl,0x1 +/* if (neverZero_counters_str[0] == '1') { CallInst *AddOv = IRB.CreateBinaryIntrinsic(Intrinsic::uadd_with_overflow, Counter, ConstantInt::get(Int8Ty, 1)); AddOv->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None)); @@ -276,7 +277,6 @@ bool AFLCoverage::runOnModule(Module &M) { } else if (neverZero_counters_str[0] == '3') { auto cf = IRB.CreateICmpEQ(Incr, ConstantInt::get(Int8Ty, 0)); Incr = IRB.CreateAdd(Incr, cf); - // Solution #4 - creates // cmp dl, $0xff // sete cl @@ -288,10 +288,11 @@ bool AFLCoverage::runOnModule(Module &M) { Incr = IRB.CreateAdd(Counter, HowMuch); } else if (neverZero_counters_str[0] == '5') { +*/ auto cf = IRB.CreateICmpEQ(Incr, ConstantInt::get(Int8Ty, 0)); auto carry = IRB.CreateZExt(cf, Int8Ty); Incr = IRB.CreateAdd(Incr, carry); - +/* } else if (neverZero_counters_str[0] == '6') { auto cf = IRB.CreateICmpULT(Incr, ConstantInt::get(Int8Ty, 1)); auto carry = IRB.CreateZExt(cf, Int8Ty); @@ -302,6 +303,7 @@ bool AFLCoverage::runOnModule(Module &M) { fprintf(stderr, "Error: unknown value for AFL_NZERO_COUNTS: %s (valid is 1-4)\n", neverZero_counters_str); exit(-1); } +*/ } IRB.CreateStore(Incr, MapPtrIdx)->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None)); |