summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/limit.c4
-rw-r--r--src/analysis/disass/loop.c4
-rw-r--r--src/analysis/disass/macro.c5
-rw-r--r--src/analysis/disass/rank.c10
4 files changed, 20 insertions, 3 deletions
diff --git a/src/analysis/disass/limit.c b/src/analysis/disass/limit.c
index 6705e1d..dd99643 100644
--- a/src/analysis/disass/limit.c
+++ b/src/analysis/disass/limit.c
@@ -105,6 +105,10 @@ void limit_all_routines(GExeFormat *format, const GArchProcessor *proc, GBinRout
start = g_arch_processor_find_instr_by_address(proc, &addr);
+
+ if (start == NULL) continue;
+
+
g_arch_instruction_set_flag(start, AIF_ROUTINE_START);
/* Si on peut se raccrocher à la routine suivante... */
diff --git a/src/analysis/disass/loop.c b/src/analysis/disass/loop.c
index d9a3f2d..94916f7 100644
--- a/src/analysis/disass/loop.c
+++ b/src/analysis/disass/loop.c
@@ -472,6 +472,10 @@ static void track_loops_in_code(const GArchProcessor *proc, const instr_coverage
size_t count; /* Taille de cette liste */
nodes = create_dragon_nodes(proc, coverage, range, start, &count);
+
+
+ if (nodes == NULL) return;
+
assert(nodes != NULL);
printf("nodes count :: %d\n", (int)count);
diff --git a/src/analysis/disass/macro.c b/src/analysis/disass/macro.c
index a9ae261..acb210a 100644
--- a/src/analysis/disass/macro.c
+++ b/src/analysis/disass/macro.c
@@ -1479,6 +1479,11 @@ void group_routines_instructions(GArchProcessor *proc, GBinRoutine **routines, s
coverage = create_code_coverage(range);
block = build_instruction_blocks(proc, coverage);
+
+
+ if (block == NULL) continue;
+
+
g_binary_routine_set_basic_blocks(routines[i], block);
diff --git a/src/analysis/disass/rank.c b/src/analysis/disass/rank.c
index 758e15d..2ad1cdf 100644
--- a/src/analysis/disass/rank.c
+++ b/src/analysis/disass/rank.c
@@ -84,7 +84,7 @@ static bool rank_flow_block(GFlowBlock *block, BlockVisitOrder order, const GIns
case ILT_EXEC_FLOW:
case ILT_CATCH_EXCEPTION:
target = G_FLOW_BLOCK(g_instr_block_find_by_addr(list, get_mrange_addr(range), true));
- assert(target != NULL);
+ //assert(target != NULL);
break;
case ILT_JUMP:
@@ -106,7 +106,7 @@ static bool rank_flow_block(GFlowBlock *block, BlockVisitOrder order, const GIns
case ILT_CASE_JUMP:
target = G_FLOW_BLOCK(g_instr_block_find_by_addr(links, get_mrange_addr(range), true));
- assert(target != NULL);
+ //assert(target != NULL);
break;
case ILT_JUMP_IF_TRUE:
@@ -150,7 +150,7 @@ static bool rank_flow_block(GFlowBlock *block, BlockVisitOrder order, const GIns
if (target == NULL)
target = G_FLOW_BLOCK(g_instr_block_find_by_addr(list, get_mrange_addr(range), true));
- assert(target != NULL);
+ //assert(target != NULL);
break;
@@ -200,6 +200,10 @@ void rank_routines_blocks(GBinRoutine **routines, size_t count, GtkExtStatusBar
{
main_block = g_binary_routine_get_basic_blocks(routines[i]);
+
+ if (main_block == NULL) continue;
+
+
g_instr_block_visit(main_block, (instr_block_visitor_cb)rank_flow_block, main_block);