diff options
Diffstat (limited to 'src/format/format.c')
-rw-r--r-- | src/format/format.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/format/format.c b/src/format/format.c index ab5b372..73e6794 100644 --- a/src/format/format.c +++ b/src/format/format.c @@ -33,6 +33,7 @@ #include "elf/elf.h" #include "java/java.h" #include "pe/pe.h" +#include "../arch/processor.h" #include "../decomp/expr/block.h" #include "../gui/panels/log.h" #include "../plugins/pglist.h" @@ -182,17 +183,28 @@ const bin_t *g_binary_format_get_content(const GBinFormat *format, off_t *length * * * Paramètres : format = description de l'exécutable à consulter. * * * -* Description : Fournit l'adresse mémoire du point d'entrée d'un binaire. * +* Description : Fournit un contexte initialisé pour un désassemblage. * * * -* Retour : Adresse de mémoire virtuelle, voire VMPA_NO_VIRTUAL. * +* Retour : Nouveau contexte pour désassemblage prêt à emploi. * * * * Remarques : - * * * ******************************************************************************/ -virt_t g_binary_format_get_entry_point(const GBinFormat *format) +GProcContext *g_binary_format_get_disassembling_context(const GBinFormat *format) { - return format->entry_point; + GProcContext *result; /* Contexte à retourner */ + GArchProcessor *proc; /* Architecture du binaire */ + size_t i; /* Boucle de parcours */ + + proc = get_arch_processor_from_format(G_EXE_FORMAT(format)); + + result = g_arch_processor_get_context(proc); + + for (i = 0; i < format->ep_count; i++) + g_proc_context_push_drop_point(result, format->entry_points[i]); + + return result; } |