From 27240161f95283b76260c570a95e11bbd2ed799d Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Tue, 20 Nov 2012 18:37:14 +0000 Subject: Fixed some links to Dalvik exception handlers. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@286 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 5 +++++ plugins/androhelpers/try_n_catch.c | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 159f811..6dcedb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +12-11-20 Cyrille Bagard + + * plugins/androhelpers/try_n_catch.c: + Fix some links to Dalvik exception handlers. + 12-11-19 Cyrille Bagard * configure.ac: diff --git a/plugins/androhelpers/try_n_catch.c b/plugins/androhelpers/try_n_catch.c index e7a3c0a..fc7b2bb 100644 --- a/plugins/androhelpers/try_n_catch.c +++ b/plugins/androhelpers/try_n_catch.c @@ -194,6 +194,7 @@ static void attach_caught_code(GLoadedBinary *binary, const try_item *try, const vmpa_t end; /* Début de la zone couverte */ GArchInstruction *instrs; /* Instructions Dalvik */ GArchInstruction *first; /* Première instruction */ + GArchInstruction *next; /* Dernière instruction + 1 */ GArchInstruction *prev; /* Instruction à détacher */ GArchInstruction *iter; /* Boucle de parcours */ size_t dests_count; /* Nombre de points d'arrivée */ @@ -207,12 +208,20 @@ static void attach_caught_code(GLoadedBinary *binary, const try_item *try, const instrs = g_loaded_binary_get_instructions(binary); first = g_arch_instruction_find_by_address(instrs, start, true); + next = g_arch_instruction_find_by_address(instrs, end, true); + + /* Si des détachements sont nécessaires... */ - /* Si un détachement est nécessaire... */ if (!g_arch_instruction_has_sources(first)) { prev = g_arch_instruction_get_prev_iter(instrs, first); - g_arch_instruction_link_with(prev, first, ILT_JUMP); + g_arch_instruction_link_with(prev, first, ILT_EXEC_FLOW); + } + + if (!g_arch_instruction_has_sources(next)) + { + prev = g_arch_instruction_get_prev_iter(instrs, next); + g_arch_instruction_link_with(prev, next, ILT_EXEC_FLOW); } /* Détermination du code des exceptions */ -- cgit v0.11.2-87-g4458