diff options
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/disass/area.c | 172 |
1 files changed, 0 insertions, 172 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c index c9612af..96de6f3 100644 --- a/src/analysis/disass/area.c +++ b/src/analysis/disass/area.c @@ -399,8 +399,6 @@ void load_code_from_mem_area_v2(mem_area_v2 *area, mem_area_v2 *list, size_t cou /* Traitement de la zone */ - printf("=== processing @ 0x%08x\n", (unsigned int)start->virtual); - forced_once = false; for (i = init_diff; i < alen; i += diff) @@ -411,9 +409,6 @@ void load_code_from_mem_area_v2(mem_area_v2 *area, mem_area_v2 *list, size_t cou * inutile. */ - printf(" (%u) blank ? %d\n", (unsigned int)i, is_range_blank_in_mem_area_v2(area, i, 1)); - printf(" +1 blank ? %d\n", is_range_blank_in_mem_area_v2(area, i + 1, 1)); - if (!is_range_blank_in_mem_area_v2(area, i, 1)) break; @@ -840,32 +835,6 @@ mem_area_v2 *compute_memory_areas_v2(const GLoadedBinary *binary, phys_t bin_len } - - - - - - - - for (i = 0; i < *count; i++) - { - printf(" (init) AREA %zu :: 0x%x / 0x%x + 0x%x\n", - i, - (unsigned int)get_phy_addr(get_mrange_addr(&result[i].range)), - (unsigned int)get_virt_addr(get_mrange_addr(&result[i].range)), - (unsigned int)get_mrange_length(&result[i].range)); - - } - - printf("--------------------\n"); - - - - - - - - /* Seconde étape : on s'assure du découpage autour des portions pour respecter l'alignement */ layer = g_exe_format_get_main_layer(format); @@ -876,12 +845,6 @@ mem_area_v2 *compute_memory_areas_v2(const GLoadedBinary *binary, phys_t bin_len { portion_start = get_mrange_addr(g_binary_portion_get_range(portions[i])); - printf(" [portion % 3zu] addr = 0x%x / 0x%x\n", - i, - (unsigned int)get_phy_addr(portion_start), - (unsigned int)get_virt_addr(portion_start)); - - /** * Si plusieurs portions débutent au même endroit, il ne sert * à rien de découper plusieurs fois. @@ -947,30 +910,6 @@ mem_area_v2 *compute_memory_areas_v2(const GLoadedBinary *binary, phys_t bin_len g_object_unref(G_OBJECT(layer)); - - - - - - for (i = 0; i < *count; i++) - { - printf(" (fini) AREA %zu :: 0x%x / 0x%x + 0x%x\n", - i, - (unsigned int)get_phy_addr(get_mrange_addr(&result[i].range)), - (unsigned int)get_virt_addr(get_mrange_addr(&result[i].range)), - (unsigned int)get_mrange_length(&result[i].range)); - - } - - printf("--------------------\n"); - - - - - - - - /* Troisième étape : on insère les symboles existants */ for (i = 0; i < sym_count; i++) @@ -1359,14 +1298,6 @@ static void init_mem_area_from_bigger_area(mem_area *area, const vmpa2t *addr, p size_t ref_index; /* Cellule de tableau visée #2 */ unsigned int ref_remaining; /* Nombre de bits restants #2 */ - - printf(" INIT_FROM (0x%08x / 0x%08x | 0x%x) : area (0x%08x / 0x%08x) len = 0x%x\n", - (unsigned int)ref->range.addr.physical, (unsigned int)ref->range.addr.virtual, - (unsigned int)ref->range.length, - (unsigned int)addr->physical, (unsigned int)addr->virtual, - (unsigned int)len); - - init_mem_area_from_addr(area, addr, len); assert(mrange_contains_mrange(&ref->range, &area->range)); @@ -1677,14 +1608,6 @@ bool load_code_from_mem_area(mem_area **list, size_t *count, size_t *index, cons copy_vmpa(&pos, get_mrange_addr(&area->range)); advance_vmpa(&pos, diff); - //printf(" [%p] CODE start @ %u (len=%u)\n", area, (unsigned int)diff, (unsigned int)alen); - - - - printf(" START @ 0x%08x\n", (unsigned int)get_virt_addr(&pos)); - - - for (i = diff; i < alen; i += diff) { /* S'il y a eu un point d'entrée en milieu de zone, on s'arrête ! */ @@ -1698,8 +1621,6 @@ bool load_code_from_mem_area(mem_area **list, size_t *count, size_t *index, cons /* TODO : valider que la taille de l'instruction obtenue ne dépasse pas la zone */ - //printf(" @ 0x%08x -> %p\n", (uint32_t)get_virt_addr(&prev), instr); - if (instr == NULL) break; /* Enregistrement des positions et adresses */ @@ -1770,22 +1691,12 @@ bool load_code_from_mem_area(mem_area **list, size_t *count, size_t *index, cons assert(!is_range_blank_in_mem_areas(*list, *count, &range)); - - if (g_arch_instruction_get_flags(instr) & AIF_RETURN_POINT) - printf("BREAK @ 0x%08x\n", (unsigned int)get_virt_addr(&prev)); - - //continue; - /* Rupture du flot d'exécution ? */ if (g_arch_instruction_get_flags(instr) & AIF_RETURN_POINT) break; } - - printf("\n"); - - g_object_unref(G_OBJECT(content)); g_object_unref(G_OBJECT(proc)); @@ -1830,7 +1741,6 @@ static void load_data_from_mem_area(mem_area *area, mem_area *list, size_t count /* On cherche à obtenir l'assurance que le traitement n'a jamais été fait */ init_mrange(&range, start, 1); - if (!is_range_blank_in_mem_areas(list, count, &range)) printf("DATA OK ! @ 0x%08x\n", (unsigned int)get_phy_addr(get_mrange_addr(&area->range))); if (!is_range_blank_in_mem_areas(list, count, &range)) return; /* Récupération des informations de base */ @@ -1854,12 +1764,6 @@ static void load_data_from_mem_area(mem_area *area, mem_area *list, size_t count copy_vmpa(&pos, get_mrange_addr(&area->range)); advance_vmpa(&pos, diff); - /* - printf(" [%p] DATA start @ 0x%08x -> %u (len=%u) => 0x%08x <-> 0x%08x\n", - area, (unsigned int)get_phy_addr(&pos), (unsigned int)diff, (unsigned int)alen, - (unsigned int)get_virt_addr(&pos), (unsigned int)(get_virt_addr(&pos) + alen)); - */ - for (i = diff; i < alen; i += diff) { /* Décodage d'une nouvelle instruction, sur mesure */ @@ -2170,25 +2074,6 @@ mem_area *compute_memory_areas(GExeFormat *format, phys_t bin_length, size_t *co symbols = g_binary_format_get_symbols(G_BIN_FORMAT(format), &sym_count); - - - - - - for (i = 0; i < exe_count; i++) - { - printf(" (init) AREA %zu :: 0x%08x + %u\n", - i, - (unsigned int)get_phy_addr(get_mrange_addr(&exe_ranges[i])), - (unsigned int)get_mrange_length(&exe_ranges[i])); - - } - - - printf("----------------\n"); - - - /* Première étape : on comble les trous ! */ last = make_vmpa(0, VMPA_NO_VIRTUAL); @@ -2252,19 +2137,6 @@ mem_area *compute_memory_areas(GExeFormat *format, phys_t bin_length, size_t *co /* Seconde étape : on s'assure du découpage autour des portions pour respecter l'alignement */ - - - for (i = 0; i < *count; i++) - { - printf(" (fini) AREA %zu :: 0x%08x + %u\n", - i, - (unsigned int)get_phy_addr(get_mrange_addr(&result[i].range)), - (unsigned int)get_mrange_length(&result[i].range)); - - } - - printf("--------------------\n"); - portions = NULL;//g_exe_format_get_portions_at_level(format, -1, &portions_count); portions_count = 0; @@ -2316,23 +2188,6 @@ mem_area *compute_memory_areas(GExeFormat *format, phys_t bin_length, size_t *co } - - - - - - for (i = 0; i < *count; i++) - { - printf(" (sect) AREA %zu :: 0x%08x + %u\n", - i, - (unsigned int)get_phy_addr(get_mrange_addr(&result[i].range)), - (unsigned int)get_mrange_length(&result[i].range)); - - } - - - - /* Troisième étape : on insère les symboles existants */ j = 0; @@ -2509,33 +2364,6 @@ static bool insert_extra_symbol_into_mem_areas(mem_area **list, size_t *count, G area = &(*list)[index]; - - - do - { - size_t i; - - printf("--- INDEX = %zu OLD_INDEX = %zu\n", index, working); - - 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 false; assert(!area->has_sym); |