diff options
author | vanhauser-thc <vh@thc.org> | 2023-12-27 13:53:11 +0100 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2023-12-27 13:53:11 +0100 |
commit | 1fc1b32db261b27cf14f0d1d7f77a06854b7376c (patch) | |
tree | 1b5e241dc505bb251a2603e5072d0a22df0bdf1d /src | |
parent | b01ef97569060bb9f7451d1c2c301b5e774b8358 (diff) | |
download | afl++-1fc1b32db261b27cf14f0d1d7f77a06854b7376c.tar.gz |
initial simple injection detection support
Diffstat (limited to 'src')
-rw-r--r-- | src/afl-cc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c index 22cce2cd..a46facc7 100644 --- a/src/afl-cc.c +++ b/src/afl-cc.c @@ -1139,6 +1139,26 @@ static void edit_params(u32 argc, char **argv, char **envp) { } + if (getenv("AFL_LLVM_INJECTIONS_ALL") || + getenv("AFL_LLVM_INJECTIONS_SQL") || + getenv("AFL_LLVM_INJECTIONS_LDAP") || + getenv("AFL_LLVM_INJECTIONS_XSS")) { + +#if LLVM_MAJOR >= 11 + #if LLVM_MAJOR < 16 + cc_params[cc_par_cnt++] = "-fexperimental-new-pass-manager"; + #endif + cc_params[cc_par_cnt++] = + alloc_printf("-fpass-plugin=%s/injection-pass.so", obj_path); +#else + cc_params[cc_par_cnt++] = "-Xclang"; + cc_params[cc_par_cnt++] = "-load"; + cc_params[cc_par_cnt++] = "-Xclang"; + cc_params[cc_par_cnt++] = alloc_printf("%s/injection-pass.so", obj_path); +#endif + + } + // cc_params[cc_par_cnt++] = "-Qunused-arguments"; } |