diff options
Diffstat (limited to 'src/format/flat.c')
-rw-r--r-- | src/format/flat.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/format/flat.c b/src/format/flat.c index b165c18..b94988f 100644 --- a/src/format/flat.c +++ b/src/format/flat.c @@ -106,8 +106,8 @@ static void g_flat_format_class_init(GFlatFormatClass *klass) exe->get_machine = (get_target_machine_fc)g_flat_format_get_target_machine; exe->get_main_addr = (get_main_addr_fc)g_flat_format_get_main_address; - exe->translate_phys = (translate_phys_fc)g_exe_format_without_virt_translate_offset_into_vmpa; - exe->translate_virt = (translate_virt_fc)g_exe_format_without_virt_translate_address_into_vmpa; + exe->translate_phys = (translate_phys_fc)g_exe_format_translate_offset_into_vmpa_using_portions; + exe->translate_virt = (translate_virt_fc)g_exe_format_translate_address_into_vmpa_using_portions; } @@ -263,8 +263,6 @@ static bool g_flat_format_analyze(GFlatFormat *format, wgroup_id_t gid, GtkStatu g_executable_format_setup_portions(G_EXE_FORMAT(format), status); - g_binary_format_register_code_point(G_BIN_FORMAT(format), 0, true); - return result; } @@ -375,10 +373,14 @@ static const char *g_flat_format_get_target_machine(const GFlatFormat *format) static bool g_flat_format_get_main_address(GFlatFormat *format, vmpa2t *addr) { bool result; /* Bilan à retourner */ + GBinFormat *base; /* Format de base du format */ - result = true; + base = G_BIN_FORMAT(format); + + result = (base->ep_count > 0); - init_vmpa(addr, 0, VMPA_NO_VIRTUAL); + if (result) + init_vmpa(addr, 0, base->entry_points[0]); return result; |