summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-11-19 21:26:51 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-11-19 21:26:51 (GMT)
commit5a70286f7f56cc72a0249fcaf404afabfb033956 (patch)
treeef2b94b04a3e84b93832749ccf6cd9b9cc370d3c /src/analysis/disass
parent760e2e7346518dd1264126c1696f9ad88884d64c (diff)
Handled Dalvik exception handlers in the graphic view.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@285 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/links.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/analysis/disass/links.c b/src/analysis/disass/links.c
index 4d799fc..7cc3c27 100644
--- a/src/analysis/disass/links.c
+++ b/src/analysis/disass/links.c
@@ -50,12 +50,14 @@ void establish_links_between_lines(GArchInstruction *list, GBinRoutine **routine
vmpa_t addr; /* Adresse référencée */
InstructionLinkType type; /* Type de référence */
GArchInstruction *target; /* Ligne visée par la référence*/
+ GArchInstruction *prev; /* Instruction précédente */
for (i = 0; i < count; i++)
{
start = g_binary_routine_get_address(routines[i]);
end = start + g_binary_routine_get_size(routines[i]);
+ /* Définition de toutes les destinations */
for (iter = g_arch_instruction_find_by_address(list, start, true);
iter != NULL;
iter = g_arch_instruction_get_next_iter(list, iter, end))
@@ -104,10 +106,39 @@ void establish_links_between_lines(GArchInstruction *list, GBinRoutine **routine
break;
+ default:
+ /**
+ * Note pour GCC : à ce stade du désassemblage, ILT_CATCH_EXCEPTION
+ * ne peut être présente, car ne provenant que de greffons.
+ * Pour ILT_EXEC_FLOW, sa seule insertion est ici, plus bas.
+ */
+ break;
+
}
}
+ /* Rattachement de deux blocs selon le flux normal */
+
+ iter = g_arch_instruction_find_by_address(list, start, true);
+
+ for (iter = g_arch_instruction_get_next_iter(list, iter, end);
+ iter != NULL;
+ iter = g_arch_instruction_get_next_iter(list, iter, end))
+ {
+ if (!g_arch_instruction_has_sources(iter))
+ continue;
+
+ prev = g_arch_instruction_get_prev_iter(list, iter);
+
+ if (g_arch_instruction_is_return(prev))
+ continue;
+
+ if (!g_arch_instruction_has_destinations(prev))
+ g_arch_instruction_link_with(prev, iter, ILT_EXEC_FLOW);
+
+ }
+
gtk_extended_status_bar_update_activity(statusbar, id, (i + 1) * 1.0 / count);
}