summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--plugins/androhelpers/try_n_catch.c13
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 <nocbos@gmail.com>
+
+ * plugins/androhelpers/try_n_catch.c:
+ Fix some links to Dalvik exception handlers.
+
12-11-19 Cyrille Bagard <nocbos@gmail.com>
* 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 */