Initial import unicornafl
This commit is contained in:
@ -849,6 +849,22 @@ static void riscv_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
|
||||
TCGOp *tcg_op, *prev_op = NULL;
|
||||
bool insn_hook = false;
|
||||
|
||||
if (uc->mode & UC_MODE_AFL) {
|
||||
// UNICORN-AFL supports (and needs) multiple exits.
|
||||
uint64_t *exits = ctx->uc->exits;
|
||||
size_t exit_count = ctx->uc->exit_count;
|
||||
if (exit_count) {
|
||||
size_t i;
|
||||
for (i = 0; i < exit_count; i++) {
|
||||
if (ctx->base.pc_next == exits[i]) {
|
||||
// Unicorn: We have to exit current execution here.
|
||||
dcbase->is_jmp = DISAS_UC_EXIT;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Unicorn: end address tells us to stop emulation
|
||||
if (ctx->base.pc_next == ctx->uc->addr_end) {
|
||||
// Unicorn: We have to exit current execution here.
|
||||
|
Reference in New Issue
Block a user