summaryrefslogtreecommitdiff
path: root/plugins/androhelpers/try_n_catch.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/androhelpers/try_n_catch.c')
-rw-r--r--plugins/androhelpers/try_n_catch.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/androhelpers/try_n_catch.c b/plugins/androhelpers/try_n_catch.c
index 94be140..d2c6043 100644
--- a/plugins/androhelpers/try_n_catch.c
+++ b/plugins/androhelpers/try_n_catch.c
@@ -111,6 +111,7 @@ static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *r
{
vmpa_t start; /* Début de la zone couverte */
vmpa_t end; /* Fin de la zone couverte */
+ GArchProcessor *proc; /* Processeur de l'architecture*/
GArchInstruction *instrs; /* Instructions Dalvik */
GArchInstruction *first; /* Première instruction */
GArchInstruction *next; /* Dernière instruction + 1 */
@@ -123,12 +124,14 @@ static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *r
end = start + try->insn_count * sizeof(uint16_t);
- instrs = g_loaded_binary_get_instructions(binary);
+ proc = g_loaded_binary_get_processor(binary);
+ instrs = g_arch_processor_get_disassembled_instructions(proc);
+
first = g_arch_instruction_find_by_address(instrs, start, true);
next = g_arch_instruction_find_by_address(instrs, end, true);
if (first == NULL || next == NULL)
- return;
+ goto acc_exit;
/* Si des détachements sont nécessaires... */
@@ -162,6 +165,10 @@ static void attach_caught_code(const GLoadedBinary *binary, const GBinRoutine *r
}
+ acc_exit:
+
+ g_object_unref(G_OBJECT(proc));
+
}
@@ -232,6 +239,7 @@ static caught_exception **build_all_destinations_list(const GLoadedBinary *binar
caught_exception **result; /* Liste de listes à retourner */
GDexFormat *format; /* Format du binaire chargé */
vmpa_t start; /* Début du code de la routine */
+ GArchProcessor *proc; /* Processeur de l'architecture*/
GArchInstruction *instrs; /* Instructions Dalvik */
uleb128_t i; /* Boucle de parcours #1 */
encoded_catch_handler *handlers; /* Groupe de gestionnaires */
@@ -244,7 +252,8 @@ static caught_exception **build_all_destinations_list(const GLoadedBinary *binar
start = g_binary_routine_get_address(routine);
- instrs = g_loaded_binary_get_instructions(binary);
+ proc = g_loaded_binary_get_processor(binary);
+ instrs = g_arch_processor_get_disassembled_instructions(proc);
instrs = g_arch_instruction_find_by_address(instrs, start, true);
/* Création d'un espace mémoire pour les listes */
@@ -302,6 +311,8 @@ static caught_exception **build_all_destinations_list(const GLoadedBinary *binar
}
+ g_object_unref(G_OBJECT(proc));
+
return result;
}