diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-11-20 18:37:14 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-11-20 18:37:14 (GMT) |
commit | 27240161f95283b76260c570a95e11bbd2ed799d (patch) | |
tree | 773fe3dda01834a2c54f5b0187be13052902d865 /plugins/androhelpers | |
parent | 5a70286f7f56cc72a0249fcaf404afabfb033956 (diff) |
Fixed some links to Dalvik exception handlers.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@286 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/androhelpers')
-rw-r--r-- | plugins/androhelpers/try_n_catch.c | 13 |
1 files changed, 11 insertions, 2 deletions
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 */ |