diff options
Diffstat (limited to 'src/format/executable.c')
-rw-r--r-- | src/format/executable.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/format/executable.c b/src/format/executable.c index a2ee569..e70840b 100644 --- a/src/format/executable.c +++ b/src/format/executable.c @@ -302,6 +302,7 @@ void g_executable_format_setup_portions(GExeFormat *format, GtkStatusStack *stat GBinFormat *base; /* Version basique du format */ vmpa2t addr; /* Emplacement vide de sens */ phys_t length; /* Taille de portion globale */ + GExeFormatClass *class; /* Classe de l'instance */ base = G_BIN_FORMAT(format); @@ -314,7 +315,10 @@ void g_executable_format_setup_portions(GExeFormat *format, GtkStatusStack *stat format->portions = g_binary_portion_new(BPC_RAW, &addr, length); - G_EXE_FORMAT_GET_CLASS(format)->refine_portions(format); + class = G_EXE_FORMAT_GET_CLASS(format); + + if (class->refine_portions != NULL) + class->refine_portions(format); } @@ -518,8 +522,15 @@ bool g_exe_format_translate_address_into_vmpa(GExeFormat *format, virt_t addr, v bool g_exe_format_get_section_range_by_name(const GExeFormat *format, const char *name, mrange_t *range) { bool result; /* Bilan à retourner */ + GExeFormatClass *class; /* Classe de l'instance */ + + class = G_EXE_FORMAT_GET_CLASS(format); - result = G_EXE_FORMAT_GET_CLASS(format)->get_range_by_name(format, name, range); + if (class->get_range_by_name == NULL) + result = false; + + else + result = class->get_range_by_name(format, name, range); return result; |