summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-01-31 21:29:49 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-01-31 21:29:49 (GMT)
commit0936f64aac6a4fa9ebc08962bc9cac663f210c00 (patch)
treee888b4d7b547680bb26082913216bc637073e734 /src/analysis/disass
parentb6341581220e92114b0838a15a1c1cec1078efc2 (diff)
Saved the first steps of switch instructions decompilation.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@335 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/macro.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/analysis/disass/macro.c b/src/analysis/disass/macro.c
index 0fef9a0..14dad95 100644
--- a/src/analysis/disass/macro.c
+++ b/src/analysis/disass/macro.c
@@ -150,7 +150,7 @@ static void find_next_jumps(GArchInstruction *instrs, vmpa_t start, vmpa_t end,
if (!g_arch_instruction_has_destinations(iter))
continue;
- dcount = g_arch_instruction_get_destinations(iter, &dests, &types);
+ dcount = g_arch_instruction_get_destinations(iter, &dests, &types, NULL);
for (i = 0; i < dcount; i++)
switch (types[i])
@@ -360,7 +360,7 @@ static GInstrBlock *build_instruction_block(GArchInstruction *instrs, vmpa_t sta
/* Adaptations en fonction du type de bifurcation */
- dcount = g_arch_instruction_get_destinations(iter, &dests, &types);
+ dcount = g_arch_instruction_get_destinations(iter, &dests, &types, NULL);
next_addr = 0;
cases_branches = NULL;
@@ -439,20 +439,22 @@ static GInstrBlock *build_instruction_block(GArchInstruction *instrs, vmpa_t sta
DELAYED_BLOCK_ADDING(result, result_cached, block);
- //printf(" --- cases --- start\n");
+ printf(" --- cases --- start\n");
next_addr = compute_first_common_addr_in_group(cases_branches, cases_count);
- //printf(" stop :: 0x%08llx\n", next_addr);
+ printf(" stop :: 0x%08llx\n", next_addr);
parent = block;
group = g_virtual_block_new();
for (j = 0; j < cases_count; j++)
{
- //printf(" ## %zu\n", j);
+ printf(" ## %zu...", j);
block = build_instruction_block(instrs, cases_branches[j].jumps[0], end, next_addr);
+ printf(" %p\n", block);
+
if (block != NULL)
g_virtual_block_add_child(G_VIRTUAL_BLOCK(group), block);
@@ -469,7 +471,7 @@ static GInstrBlock *build_instruction_block(GArchInstruction *instrs, vmpa_t sta
else
g_object_unref(G_OBJECT(group));
- //printf(" --- cases --- end\n");
+ printf(" --- cases --- end\n");
free(cases_branches);