diff options
Diffstat (limited to 'src/format/executable.c')
-rw-r--r-- | src/format/executable.c | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/src/format/executable.c b/src/format/executable.c new file mode 100644 index 0000000..4fb6b41 --- /dev/null +++ b/src/format/executable.c @@ -0,0 +1,144 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * executable.c - support des formats d'exécutables + * + * Copyright (C) 2009 Cyrille Bagard + * + * This file is part of OpenIDA. + * + * OpenIDA is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * OpenIDA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "executable.h" + + +#include "executable-int.h" +#include "format.h" + + + +/* Initialise la classe des formats d'exécutables génériques. */ +static void g_executable_format_class_init(GExeFormatClass *); + +/* Initialise une instance de format d'exécutable générique. */ +static void g_executable_format_init(GExeFormat *); + + + +/* Indique le type défini pour un format d'exécutable générique. */ +G_DEFINE_TYPE(GExeFormat, g_executable_format, G_TYPE_BIN_FORMAT); + + +/****************************************************************************** +* * +* Paramètres : klass = classe à initialiser. * +* * +* Description : Initialise la classe des formats d'exécutables génériques. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_executable_format_class_init(GExeFormatClass *klass) +{ + +} + + +/****************************************************************************** +* * +* Paramètres : format = instance à initialiser. * +* * +* Description : Initialise une instance de format d'exécutable générique. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_executable_format_init(GExeFormat *format) +{ + +} + + + + + + + + + + + +/****************************************************************************** +* * +* Paramètres : format = informations chargées à consulter. * +* * +* Description : Indique le type d'architecture visée par le format. * +* * +* Retour : Identifiant de l'architecture ciblée par le format. * +* * +* Remarques : - * +* * +******************************************************************************/ + +FormatTargetMachine g_exe_format_get_target_machine(const GExeFormat *format) +{ + return format->get_machine(format); + +} + + +/****************************************************************************** +* * +* Paramètres : format = informations chargées à consulter. * +* * +* Description : Fournit l'adresse mémoire du point d'entrée du programme. * +* * +* Retour : Adresse de mémoire. * +* * +* Remarques : - * +* * +******************************************************************************/ + +vmpa_t g_exe_format_get_entry_point(const GExeFormat *format) +{ + return format->get_entry_point(format); + +} + + +/****************************************************************************** +* * +* Paramètres : format = informations chargées à consulter. * +* count = quantité de zones listées. [OUT] * +* * +* Description : Fournit les références aux zones binaires à analyser. * +* * +* Retour : Zones binaires à analyser. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GBinPart **g_exe_format_get_parts(const GExeFormat *format, size_t *count) +{ + return format->get_parts(format, count); + +} |