diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/disass/area.c | 23 | ||||
-rw-r--r-- | src/analysis/disass/fetch.c | 5 | ||||
-rw-r--r-- | src/arch/arm/v7/fetch.c | 13 |
3 files changed, 38 insertions, 3 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c index 6ce9272..a0ad90e 100644 --- a/src/analysis/disass/area.c +++ b/src/analysis/disass/area.c @@ -614,7 +614,7 @@ bool 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)); + assert(!is_range_blank_in_mem_areas(*list, *count, &range)); if (g_arch_instruction_is_return(instr)) @@ -1569,6 +1569,27 @@ size_t find_memory_area_by_addr(mem_area *list, size_t count, const vmpa2t *addr } + /* + if (addr->virtual == 0x8540) + { + size_t i; + + for (i = 0; i < count; i++) + printf("[%zu] AREAS :: 0x%08x + %x\n", i, + (unsigned int)list[i].range.addr.virtual, + (unsigned int)list[i].range.length); + + + + + printf(" == CMP == 0x%08x / 0x%08x\n", + (unsigned int)addr->physical, + (unsigned int)addr->virtual); + + } + */ + + found = bsearch(addr, list, count, sizeof(mem_area), (__compar_fn_t)find_mem_area); result = (found != NULL ? found - list : count); diff --git a/src/analysis/disass/fetch.c b/src/analysis/disass/fetch.c index 16b81c8..b30d5a6 100644 --- a/src/analysis/disass/fetch.c +++ b/src/analysis/disass/fetch.c @@ -63,6 +63,7 @@ static void ensure_all_mem_areas_are_filled(mem_area **, size_t *, const GLoaded static void follow_execution_flow(const GLoadedBinary *binary, GProcContext *ctx, mem_area **areas, size_t *count, status_blob_info *info, virt_t virt) { vmpa2t addr; /* Conversion en pleine adresse*/ + GExeFormat *format; /* Format du fichier binaire */ size_t index; /* Zone trouvée à traiter */ printf("-- follow 0x%08x\n", (unsigned int)virt); @@ -73,9 +74,11 @@ static void follow_execution_flow(const GLoadedBinary *binary, GProcContext *ctx while (g_proc_context_has_drop_points(ctx)) { virt = g_proc_context_pop_drop_point(ctx); - init_vmpa(&addr, VMPA_NO_PHYSICAL, virt); + format = g_loaded_binary_get_format(binary); + if (!g_exe_format_translate_address_into_vmpa(format, virt, &addr)) + init_vmpa(&addr, VMPA_NO_PHYSICAL, virt); printf(" ++ point 0x%08x\n", (unsigned int)virt); diff --git a/src/arch/arm/v7/fetch.c b/src/arch/arm/v7/fetch.c index 18d61f0..246d136 100644 --- a/src/arch/arm/v7/fetch.c +++ b/src/arch/arm/v7/fetch.c @@ -139,7 +139,18 @@ void help_fetching_with_instruction_bl_with_orig(GArchInstruction *instr, GArchP assert(get_mrange_length(range) == 4); - pc += 4; + switch (iset) + { + case AV7IS_ARM: + pc += 8; + break; + case AV7IS_THUMB: + pc += 4; + break; + default: + assert(0); + break; + } op = g_arch_instruction_get_operand(instr, 0); |