diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-07-12 11:32:03 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-07-12 11:32:03 (GMT) |
commit | 254254db8c09eb4b4f8523e73551c13ec281d194 (patch) | |
tree | 730beb552a9d300e71f583fc40ef5a5b9dc40b42 /plugins/androhelpers/try_n_catch.c | |
parent | ba1d7ae3ae3c82ab2c3d23a900c16baff6f8ca26 (diff) |
Only given access to instructions from a processor.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@547 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/androhelpers/try_n_catch.c')
-rw-r--r-- | plugins/androhelpers/try_n_catch.c | 17 |
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; } |