diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/androhelpers/switch.c | 2 | ||||
-rw-r--r-- | plugins/androhelpers/try_n_catch.c | 6 | ||||
-rw-r--r-- | plugins/libcsem/exit.c | 15 |
3 files changed, 13 insertions, 10 deletions
diff --git a/plugins/androhelpers/switch.c b/plugins/androhelpers/switch.c index 275a6e7..20e6037 100644 --- a/plugins/androhelpers/switch.c +++ b/plugins/androhelpers/switch.c @@ -219,7 +219,7 @@ static void ensure_each_case_has_its_block(GArchInstruction *instr, GArchInstruc prev = g_arch_instruction_get_prev_iter(instrs, instr); if (prev != NULL - && !g_arch_instruction_has_destinations(prev) + && g_arch_instruction_count_destinations(prev) == 0 && !(g_arch_instruction_get_flags(prev) & AIF_RETURN_POINT)) { g_arch_instruction_link_with(prev, instr, ILT_EXEC_FLOW); diff --git a/plugins/androhelpers/try_n_catch.c b/plugins/androhelpers/try_n_catch.c index 9052377..5dff71e 100644 --- a/plugins/androhelpers/try_n_catch.c +++ b/plugins/androhelpers/try_n_catch.c @@ -135,13 +135,13 @@ static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *r /* Si des détachements sont nécessaires... */ - if (!g_arch_instruction_has_sources(first) && try->start_addr > 0) + if (g_arch_instruction_count_sources(first) == 0 && try->start_addr > 0) { prev = g_arch_instruction_get_prev_iter(instrs, first); g_arch_instruction_link_with(prev, first, ILT_EXEC_FLOW); } - if (!g_arch_instruction_has_sources(next) && (try->start_addr > 0 || try->insn_count > 0)) + if (g_arch_instruction_count_sources(next) == 0 && (try->start_addr > 0 || try->insn_count > 0)) { prev = g_arch_instruction_get_prev_iter(instrs, next); g_arch_instruction_link_with(prev, next, ILT_EXEC_FLOW); @@ -155,7 +155,7 @@ static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *r iter != NULL; iter = g_arch_instruction_get_next_iter(instrs, iter, end)) { - if (!g_arch_instruction_has_destinations(iter)) + if (g_arch_instruction_count_destinations(iter) == 0) continue; for (i = 0; i < count; i++) diff --git a/plugins/libcsem/exit.c b/plugins/libcsem/exit.c index 6695787..6a21d5f 100644 --- a/plugins/libcsem/exit.c +++ b/plugins/libcsem/exit.c @@ -52,9 +52,9 @@ static void mark_one_kind_of_exit_as_return(const GLoadedBinary *binary, const c const mrange_t *range; /* Emplacement du symbole */ GArchProcessor *proc; /* Architecture du binaire */ GArchInstruction *instr; /* Instruction de sortie */ - instr_link_t *sources; /* Instructions diverses liées */ size_t count; /* Nbre de sources affichées */ size_t i; /* Boucle de parcours */ + instr_link_t *source; /* Instruction diverse liée */ format = G_BIN_FORMAT(g_loaded_binary_get_format(binary)); @@ -73,18 +73,21 @@ static void mark_one_kind_of_exit_as_return(const GLoadedBinary *binary, const c if (instr == NULL) goto mokoear_not_found; - g_arch_instruction_rlock_src(instr); - count = g_arch_instruction_get_sources(instr, &sources); + g_arch_instruction_lock_src(instr); + + count = g_arch_instruction_count_sources(instr); for (i = 0; i < count; i++) { - if (sources[i].type != ILT_CALL) continue; + source = g_arch_instruction_get_source(instr, i); + + if (source->type != ILT_CALL) continue; - g_arch_instruction_set_flag(sources[i].linked, AIF_RETURN_POINT); + g_arch_instruction_set_flag(source->linked, AIF_RETURN_POINT); } - g_arch_instruction_runlock_src(instr); + g_arch_instruction_unlock_src(instr); g_object_unref(G_OBJECT(instr)); |