diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-05-21 12:08:29 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-05-21 12:08:29 (GMT) |
commit | 7e5b1add6fdeb74b2356acf8ccf7009f45cfa85e (patch) | |
tree | b7373554017e97fcbe24db79d9818272764e858d /src/format/format.c | |
parent | 5dd935b27a765177960bdfe4d2fcb296cbbd41da (diff) |
Changed the hierarchy of format objects.
Diffstat (limited to 'src/format/format.c')
-rw-r--r-- | src/format/format.c | 181 |
1 files changed, 1 insertions, 180 deletions
diff --git a/src/format/format.c b/src/format/format.c index 18ddc03..0cebc98 100644 --- a/src/format/format.c +++ b/src/format/format.c @@ -66,7 +66,7 @@ static bool __g_binary_format_find_symbol(const GBinFormat *, const void *, __co /* Indique le type défini pour un format binaire générique. */ -G_DEFINE_TYPE(GBinFormat, g_binary_format, G_TYPE_OBJECT); +G_DEFINE_TYPE(GBinFormat, g_binary_format, G_TYPE_KNOWN_FORMAT); /****************************************************************************** @@ -162,8 +162,6 @@ static void g_binary_format_dispose(GBinFormat *format) { size_t i; /* Boucle de parcours */ - g_clear_object(&format->content); - g_rw_lock_clear(&format->pt_lock); g_clear_object(&format->info); @@ -223,75 +221,6 @@ static void g_binary_format_finalize(GBinFormat *format) /****************************************************************************** * * -* Paramètres : format = instance à traiter. * -* status = barre de statut à tenir informée. * -* * -* Description : Effectue les ultimes opérations de chargement d'un binaire. * -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool g_binary_format_complete_loading(GBinFormat *format, GtkStatusStack *status) -{ - return true; - -} - - -/****************************************************************************** -* * -* Paramètres : format = description de l'exécutable à consulter. * -* content = contenu binaire à parcourir. * -* * -* Description : Définit le contenu binaire à analyser. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void g_binary_format_set_content(GBinFormat *format, GBinContent *content) -{ - assert(format->content == NULL); - - g_object_ref(G_OBJECT(content)); - - format->content = content; - -} - - -/****************************************************************************** -* * -* Paramètres : format = description de l'exécutable à consulter. * -* * -* Description : Fournit une référence vers le contenu binaire analysé. * -* * -* Retour : Gestionnaire de contenu binaire en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GBinContent *g_binary_format_get_content(const GBinFormat *format) -{ - GBinContent *result; /* Instance à retourner */ - - result = format->content; - - g_object_ref(G_OBJECT(result)); - - return result; - -} - - -/****************************************************************************** -* * * Paramètres : format = format à venir modifier. * * flag = drapeau d'information complémentaire à planter. * * * @@ -421,84 +350,6 @@ FormatFlag g_binary_format_get_flags(const GBinFormat *format) * * * Paramètres : format = description de l'exécutable à consulter. * * * -* Description : Indique la désignation interne du format. * -* * -* Retour : Description du format. * -* * -* Remarques : - * -* * -******************************************************************************/ - -const char *g_binary_format_get_name(const GBinFormat *format) -{ - const char *result; /* Désignation à retourner */ - - result = G_BIN_FORMAT_GET_CLASS(format)->get_name(format); - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : format = description de l'exécutable à consulter. * -* * -* Description : Fournit une description humaine du format. * -* * -* Retour : Description du format. * -* * -* Remarques : - * -* * -******************************************************************************/ - -const char *g_binary_format_get_description(const GBinFormat *format) -{ - const char *result; /* Désignation à retourner */ - - result = G_BIN_FORMAT_GET_CLASS(format)->get_desc(format); - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : format = format chargé dont l'analyse est lancée. * -* gid = groupe de travail dédié. * -* status = barre de statut à tenir informée. * -* * -* Description : Assure l'interprétation d'un format en différé. * -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool g_binary_format_analyze(GBinFormat *format, wgroup_id_t gid, GtkStatusStack *status) -{ - bool result; /* Bilan à retourner */ - GBinFormatClass *class; /* Classe de l'instance */ - - handle_binary_format_analysis(PGA_FORMAT_ANALYSIS_STARTED, format, gid, status); - - class = G_BIN_FORMAT_GET_CLASS(format); - - result = class->analyze(format, gid, status); - - handle_binary_format_analysis(PGA_FORMAT_ANALYSIS_ENDED, format, gid, status); - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : format = description de l'exécutable à consulter. * -* * * Description : Indique le boutisme employé par le format binaire analysé. * * * * Retour : Boutisme associé au format. * @@ -601,36 +452,6 @@ void g_binary_format_activate_disassembling_context(GBinFormat *format, GProcCon } -/****************************************************************************** -* * -* Paramètres : format = description de l'exécutable à manipuler. * -* gid = groupe de travail dédié. * -* status = barre de statut à tenir informée. * -* * -* Description : Réalise un traitement post-désassemblage. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void g_binary_format_complete_analysis(GBinFormat *format, wgroup_id_t gid, GtkStatusStack *status) -{ - GBinFormatClass *class; /* Classe de l'instance */ - - handle_binary_format_analysis(PGA_FORMAT_POST_ANALYSIS_STARTED, format, gid, status); - - class = G_BIN_FORMAT_GET_CLASS(format); - - if (class->complete != NULL) - class->complete(format, gid, status); - - handle_binary_format_analysis(PGA_FORMAT_POST_ANALYSIS_ENDED, format, gid, status); - -} - - /* ---------------------------------------------------------------------------------- */ /* DECODAGE DE SYMBOLES */ |