From ec63e8c3dbea7e18bf3c2dd18d1216c5906f704e Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 16 Mar 2018 03:28:38 +0100 Subject: finished dynamorio changes --- afl-dyninst.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'afl-dyninst.cpp') diff --git a/afl-dyninst.cpp b/afl-dyninst.cpp index 7822fd9..d9db33a 100644 --- a/afl-dyninst.cpp +++ b/afl-dyninst.cpp @@ -52,7 +52,7 @@ static const char *USAGE = "-dfvD -i -o -l -e getImage(); /* Find code coverage functions in the instrumentation library */ - BPatch_function *initAflForkServer = findFuncByName(appImage, (char *) "initAflForkServer"); + BPatch_function *initAflForkServer; save_rdi = findFuncByName(appImage, (char *) "save_rdi"); restore_rdi = findFuncByName(appImage, (char *) "restore_rdi"); BPatch_function *bbCallback = findFuncByName(appImage, (char *) "bbCallback"); BPatch_function *forceCleanExit = findFuncByName(appImage, (char *) "forceCleanExit"); + if (do_bb == true) + initAflForkServer = findFuncByName(appImage, (char *) "initAflForkServer"); + else + initAflForkServer = findFuncByName(appImage, (char *) "initOnlyAflForkServer"); + if (!initAflForkServer || !bbCallback || !save_rdi || !restore_rdi || !forceCleanExit) { cerr << "Instrumentation library lacks callbacks!" << endl; return EXIT_FAILURE; @@ -340,7 +347,7 @@ int main(int argc, char **argv) { continue; } - if (do_bb) { + if (do_bb == true) { cout << "Instrumenting module: " << moduleName << endl; vector < BPatch_function * >*allFunctions = (*moduleIter)->getProcedures(); vector < BPatch_function * >::iterator funcIter; -- cgit 1.4.1