/* OpenIDA - Outil d'analyse de fichiers binaires * part.h - prototypes pour la manipulation des parties de code * * Copyright (C) 2009-2011 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 . */ #ifndef _FORMAT_PART_H #define _FORMAT_PART_H #include #include #include "../common/xml.h" #include "../arch/archbase.h" #define G_TYPE_BIN_PART (g_binary_part_get_type()) #define G_BIN_PART(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_BIN_PART, GBinPart)) #define G_IS_BIN_PART(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_BIN_PART)) #define G_BIN_PART_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_BIN_PART, GBinPartClass)) #define G_IS_BIN_PART_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_BIN_PART)) #define G_BIN_PART_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_BIN_PART, GBinPartClass)) /* Bloc de données binaires quelconques (instance) */ typedef struct _GBinPart GBinPart; /* Bloc de données binaires quelconques (classe) */ typedef struct _GBinPartClass GBinPartClass; /* Indique le type défini par la GLib pour les blocs de doonées. */ GType g_binary_part_get_type(void); /* Crée une description de partie de code vierge. */ GBinPart *g_binary_part_new(void); /* Crée une description de partie de code à partir d'une autre. */ GBinPart *g_binary_part_dump(const GBinPart *); /* Crée une description de partie de code vierge à partir d'XML. */ GBinPart *g_binary_part_load_from_xml(xmlNodePtr); /* Enregistre les informations d'une partie de code dans du XML. */ bool g_binary_part_save_to_xml(const GBinPart *, xmlDocPtr, xmlNodePtr); /* Attribue une description humaine à une partie de code. */ void g_binary_part_set_name(GBinPart *, const char *); /* Fournit la description attribuée à une partie de code. */ const char *g_binary_part_get_name(const GBinPart *); /* Définit les valeurs utiles d'une partie de code. */ void g_binary_part_set_values(GBinPart *, off_t, off_t, vmpa_t); /* Définit l'adresse virtuelle d'une partie de code. */ void g_binary_part_set_address(GBinPart *, vmpa_t); /* Fournit les valeurs utiles d'une partie de code. */ void g_binary_part_get_values(const GBinPart *, off_t *, off_t *, vmpa_t *); /* Etablit la comparaison entre deux blocs binaires. */ int g_binary_part_compare(const GBinPart **, const GBinPart **); #ifdef DEBUG /* Mémorise un bilan de désassemblage. */ void g_binary_part_set_checkup(GBinPart *, unsigned int, unsigned int); /* Mémorise un bilan de désassemblage. */ void g_binary_part_get_checkup(const GBinPart *, unsigned int *, unsigned int *); #endif #endif /* _FORMAT_PART_H */