summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/area.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c
index 600818a..17df2af 100644
--- a/src/analysis/disass/area.c
+++ b/src/analysis/disass/area.c
@@ -359,10 +359,14 @@ static bool mark_range_in_mem_area_as_processed(mem_area *area, phys_t start, ph
index = i / (sizeof(unsigned long) * 8);
remaining = i % (sizeof(unsigned long) * 8);
+ assert((area->processed[index] & (1ul << remaining)) == 0);
+
area->processed[index] |= (1ul << remaining);
}
+ assert(area->instructions[start] == NULL);
+
area->instructions[start] = instr;
return true;
@@ -464,7 +468,8 @@ void load_code_from_mem_area(mem_area **list, size_t *count, size_t *index, cons
for (i = diff; i < alen; i += diff)
{
- //il y a eu un point d'entrée... -> STOP
+ /* S'il y a eu un point d'entrée en milieu de zone, on s'arrête ! */
+ if (!is_range_blank_in_mem_area(area, i, 1, NULL)) break;
/* Décodage d'une nouvelle instruction */
@@ -503,7 +508,7 @@ void load_code_from_mem_area(mem_area **list, size_t *count, size_t *index, cons
has_new_sym = g_proc_context_pop_new_symbol_at(ctx, &sym_addr))
{
printf("depop :: %x / %x\n", (unsigned int)sym_addr.physical, (unsigned int)sym_addr.virtual);
-
+ //continue;
//if (sym_addr.physical != 0x5bc && sym_addr.physical != 0x5c0) continue;
//if (sym_addr.physical != 0x5bc) continue;
@@ -558,6 +563,8 @@ void load_code_from_mem_area(mem_area **list, size_t *count, size_t *index, cons
}
+ assert(1 && !is_range_blank_in_mem_areas(*list, *count, &range));
+
if (g_arch_instruction_is_return(instr))
printf("BREAK @ 0x%08x\n", (unsigned int)get_virt_addr(&prev));
@@ -1306,9 +1313,37 @@ static bool insert_extra_symbol_into_mem_areas(mem_area **list, size_t *count, s
index = find_memory_area_by_addr(*list, *count, get_mrange_addr(sym_range));
assert(index < *count);
- if (index <= *old_index) (*old_index)++;
+ //if (index <= *old_index) (*old_index)++;
area = &(*list)[index];
+
+
+ if (strcmp("Value used @ 0x00008a26", g_db_comment_get_text(g_binary_symbol_get_comment(symbol))) == 0)
+ printf("break\n");
+
+
+ do
+ {
+ size_t i;
+
+ printf("--- comment '%s'...\n",
+ g_db_comment_get_text(g_binary_symbol_get_comment(symbol)));
+
+ printf("--- insert @ 0x%04x + %u\n",
+ get_phy_addr(get_mrange_addr(sym_range)), get_mrange_length(sym_range));
+
+ for (i = 0; i < 3; i++)
+ printf("area [ %zu ] <=> 0x%04x + %u (sym ? %d)\n",
+ index - 1 + i,
+ get_phy_addr(get_mrange_addr(&(&(*list)[index - 1 + i])->range)),
+ get_mrange_length(&(&(*list)[index - 1 + i])->range),
+ (&(*list)[index - 1 + i])->has_sym);
+
+ }
+ while (0);
+
+ if (area->has_sym) return true;
+
assert(!area->has_sym);
saved = *area;