Initial import unicornafl

This commit is contained in:
2021-10-25 00:51:16 +02:00
parent 91451aa2f5
commit dd7476a9bd
42 changed files with 2269 additions and 1 deletions

View File

@@ -7625,6 +7625,21 @@ static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
LOG_DISAS("nip=" TARGET_FMT_lx " super=%d ir=%d\n",
ctx->base.pc_next, ctx->mem_idx, (int)msr_ir);
if (uc->mode & UC_MODE_AFL) {
// UNICORN-AFL supports (and needs) multiple exits.
uint64_t *exits = uc->exits;
size_t exit_count = uc->exit_count;
if (exit_count) {
size_t i;
for (i = 0; i < exit_count; i++) {
if (ctx->base.pc_next == exits[i]) {
gen_wait(ctx);
return;
}
}
}
}
// Unicorn: end address tells us to stop emulation
if (ctx->base.pc_next == uc->addr_end) {
gen_wait(ctx);