diff options
Diffstat (limited to 'src/analysis/routine.c')
-rw-r--r-- | src/analysis/routine.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/analysis/routine.c b/src/analysis/routine.c index f84a5fd..583e151 100644 --- a/src/analysis/routine.c +++ b/src/analysis/routine.c @@ -1169,9 +1169,9 @@ char *g_binary_routine_build_tooltip(const GBinRoutine *routine, const GLoadedBi GBufferCache *cache; /* Tampon de désassemblage */ instr_iter_t *iter; /* Parcours local d'adresses */ GArchInstruction *instr; /* Instruction correspondante */ - instr_link_t *dests; /* Instr. visées par une autre */ size_t dcount; /* Nombre de liens de dest. */ size_t i; /* Boucle de parcours */ + instr_link_t *dest; /* Instr. visée par une autre */ const mrange_t *irange; /* Emplacement d'instruction */ size_t index; /* Indice de ligne à traiter */ GBufferLine *line; /* Ligne présente à l'adresse */ @@ -1180,7 +1180,6 @@ char *g_binary_routine_build_tooltip(const GBinRoutine *routine, const GLoadedBi result = NULL; - config = get_main_configuration(); if (!g_generic_config_get_value(config, MPK_TOOLTIP_MAX_CALLS, &max_calls)) @@ -1219,11 +1218,14 @@ char *g_binary_routine_build_tooltip(const GBinRoutine *routine, const GLoadedBi /* Appels ? */ - g_arch_instruction_rlock_dest(instr); - dcount = g_arch_instruction_get_destinations(instr, &dests); + g_arch_instruction_lock_dest(instr); + dcount = g_arch_instruction_count_destinations(instr); for (i = 0; i < dcount; i++) - switch (dests[i].type) + { + dest = g_arch_instruction_get_destination(instr, i); + + switch (dest->type) { case ILT_CALL: @@ -1272,10 +1274,10 @@ char *g_binary_routine_build_tooltip(const GBinRoutine *routine, const GLoadedBi case ILT_REF: - if (!G_IS_RAW_INSTRUCTION(dests[i].linked)) + if (!G_IS_RAW_INSTRUCTION(dest->linked)) continue; - if (!g_raw_instruction_is_string(G_RAW_INSTRUCTION(dests[i].linked))) + if (!g_raw_instruction_is_string(G_RAW_INSTRUCTION(dest->linked))) continue; string_count++; @@ -1289,7 +1291,7 @@ char *g_binary_routine_build_tooltip(const GBinRoutine *routine, const GLoadedBi continue; } - irange = g_arch_instruction_get_range(dests[i].linked); + irange = g_arch_instruction_get_range(dest->linked); index = g_buffer_cache_find_index_by_addr(cache, get_mrange_addr(irange), true); @@ -1326,7 +1328,9 @@ char *g_binary_routine_build_tooltip(const GBinRoutine *routine, const GLoadedBi } - g_arch_instruction_runlock_dest(instr); + } + + g_arch_instruction_unlock_dest(instr); g_object_unref(G_OBJECT(instr)); |