Пример #1
0
// Execute taint ops
int after_block_exec(CPUState *env, TranslationBlock *tb,
        TranslationBlock *next_tb){
    if (taintJustEnabled){
        // need to wait until the next TB to start executing taint ops
        taintJustEnabled = false;
        return 0;
    }
    if (taintJustDisabled){
        taintJustDisabled = false;
        execute_llvm = 0;
        generate_llvm = 0;
        panda_do_flush_tb();
        panda_disable_memcb();
        return 0;
    }
    if (taintEnabled){
        DynValBuffer *dynval_buffer = PIFP->PIV->getDynvalBuffer();
        rewind_dynval_buffer(dynval_buffer);

        //printf("%s\n", tb->llvm_function->getName().str().c_str());
        //PTFP->debugTaintOps();
        //printf("\n\n");
        execute_taint_ops(PTFP->ttb, shadow, dynval_buffer);

        // Make sure there's nothing left in the buffer
        assert(dynval_buffer->ptr - dynval_buffer->start == dynval_buffer->cur_size);
    }
    return 0;
}
Пример #2
0
// Execute taint ops
int after_block_exec(CPUState *env, TranslationBlock *tb,
        TranslationBlock *next_tb){

    if (taintJustDisabled){
        taintJustDisabled = false;
        execute_llvm = 0;
        generate_llvm = 0;
        panda_do_flush_tb();
        panda_disable_memcb();
	//	mytimer_start(ttimer);
        return 0;
    }

    return 0;
}
Пример #3
0
void panda_enable_llvm(void){
    panda_do_flush_tb();
    execute_llvm = 1;
    generate_llvm = 1;
    tcg_llvm_ctx = tcg_llvm_initialize();
}