From aab93926dc473e7931823b7e75aaa90ba8710477 Mon Sep 17 00:00:00 2001 From: lazymio Date: Tue, 26 Apr 2022 01:05:12 +0200 Subject: [PATCH] Fix a bug when nested uc_emu_start deletes a hook --- uc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/uc.c b/uc.c index bc507194..8a58c10d 100644 --- a/uc.c +++ b/uc.c @@ -847,10 +847,11 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until, // or we may lost uc_emu_stop if (uc->nested_level == 0) { uc->emulation_done = true; - } - // remove hooks to delete - clear_deleted_hooks(uc); + // remove hooks to delete + // make sure we delete all hooks at the first level. + clear_deleted_hooks(uc); + } if (timeout) { // wait for the timer to finish