/* Chrysalide - Outil d'analyse de fichiers binaires * format-int.h - prototypes utiles aux formats binaires * * Copyright (C) 2009-2017 Cyrille Bagard * * This file is part of Chrysalide. * * Chrysalide 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. * * Chrysalide 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_FORMAT_INT_H #define _FORMAT_FORMAT_INT_H #include "format.h" #include "../gtkext/gtkstatusstack.h" /* ------------------------ TRAITEMENT INDIVIDUEL DE FORMATS ------------------------ */ /* Indique le boutisme employé par le format binaire analysé. */ typedef SourceEndian (* format_get_endian_fc) (const GBinFormat *); /* Procède à la décompilation complète du format. */ typedef void (* format_decompile_fc) (const GBinFormat *, void/*GCodeBuffer*/ *, const char *); /* Rythme des allocations pour les entrées de code */ #define EXTRA_POINT_BLOCK 100 /* Format binaire générique (instance) */ struct _GBinFormat { GObject parent; /* A laisser en premier */ GBinContent *content; /* Contenu binaire à étudier */ virt_t *entry_points; /* Points d'entrée du code */ size_t ep_count; /* Nombre de ces points */ virt_t *extra_points; /* Autres débuts de code */ size_t xp_allocated; /* Taille d'inscription allouée*/ size_t xp_count; /* Nombre de points enregistrés*/ GRWLock pt_lock; /* Accès à la liste des points */ GBinSymbol **symbols; /* Liste des symboles trouvés */ size_t symbols_count; /* Quantité de ces symboles */ GRWLock syms_lock; /* Accès à la liste de symboles*/ GBinRoutine **routines; /* Liste des routines trouvées */ size_t routines_count; /* Nombre de ces routines */ const char **src_files; /* Nom des fichiers source */ size_t src_count; /* Taille de la liste */ size_t def_source; /* Fichier source principal */ format_decompile_fc decompile; /* Décompilation d'un fichier */ }; /* Format binaire générique (classe) */ struct _GBinFormatClass { GObjectClass parent; /* A laisser en premier */ format_get_endian_fc get_endian; /* Boutisme employé */ }; /* Effectue les ultimes opérations de chargement d'un binaire. */ bool g_binary_format_complete_loading(GBinFormat *, GtkStatusStack *); /* Définit le contenu binaire à analyser. */ void g_binary_format_set_content(GBinFormat *, GBinContent *); #endif /* _FORMAT_FORMAT_INT_H */