summaryrefslogtreecommitdiff
path: root/src/analysis/loaded.h
blob: 9df647b90ba66187709eb0747b50ba6f5b361d65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

/* Chrysalide - Outil d'analyse de fichiers binaires
 * loaded.h - prototypes pour l'intégration des contenus chargés
 *
 * Copyright (C) 2017-2019 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 Chrysalide.  If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef _ANALYSIS_LOADED_H
#define _ANALYSIS_LOADED_H


#include <glib-object.h>
#include <stdbool.h>
#include <gtk/gtk.h>


#include "content.h"
#include "../common/xml.h"
#include "../glibext/gdisplayoptions.h"
#include "../gtkext/gtkdockstation.h"



/* ---------------------- GESTION SOUS FORME DE CONTENU CHARGE ---------------------- */


#define G_TYPE_LOADED_CONTENT             (g_loaded_content_get_type())
#define G_LOADED_CONTENT(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_LOADED_CONTENT, GLoadedContent))
#define G_LOADED_CONTENT_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST((vtable), G_TYPE_LOADED_CONTENT, GLoadedContentIface))
#define G_IS_LOADED_CONTENT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_LOADED_CONTENT))
#define G_IS_LOADED_CONTENT_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE((vtable), G_TYPE_LOADED_CONTENT))
#define G_LOADED_CONTENT_GET_IFACE(inst)  (G_TYPE_INSTANCE_GET_INTERFACE((inst), G_TYPE_LOADED_CONTENT, GLoadedContentIface))


/* Accès à un contenu binaire quelconque (coquille vide) */
typedef struct _GLoadedContent GLoadedContent;

/* Accès à un contenu binaire quelconque (interface) */
typedef struct _GLoadedContentIface GLoadedContentIface;


/* Détermine le type d'une interface pour l'intégration de contenu chargé. */
GType g_loaded_content_get_type(void) G_GNUC_CONST;

/* Interprète un contenu chargé avec un appui XML. */
bool g_loaded_content_restore(GLoadedContent *, xmlDoc *, xmlXPathContext *, const char *);

/* Ecrit une sauvegarde de l'élément dans un fichier XML. */
bool g_loaded_content_save(GLoadedContent *, xmlDoc *, xmlXPathContext *, const char *);

/* Fournit le contenu représenté de l'élément chargé. */
GBinContent *g_loaded_content_get_content(const GLoadedContent *);

/* Fournit le format associé à l'élément chargé. */
const char *g_loaded_content_get_format_name(const GLoadedContent *);

/* Lance l'analyse propre à l'élément chargé. */
void g_loaded_content_analyze(GLoadedContent *, bool, bool);

/* Lance l'analyse de l'élément chargé et attend sa conclusion. */
bool g_loaded_content_analyze_and_wait(GLoadedContent *, bool, bool);

/* Fournit le désignation associée à l'élément chargé. */
const char *g_loaded_content_describe(const GLoadedContent *, bool);

/* Etablit une liste d'obscurcissements présents. */
char **g_loaded_content_detect_obfuscators(const GLoadedContent *, bool, size_t *);



/* --------------------------- GESTION DYNAMIQUE DES VUES --------------------------- */


/* Détermine le nombre de vues disponibles pour un contenu. */
unsigned int g_loaded_content_count_views(const GLoadedContent *);

/* Fournit le nom d'une vue donnée d'un contenu chargé. */
const char *g_loaded_content_get_view_name(const GLoadedContent *, unsigned int);

/* Met en place la vue initiale pour un contenu chargé. */
GtkWidget *g_loaded_content_build_default_view(GLoadedContent *);

/* Met en place la vue demandée pour un contenu chargé. */
GtkWidget *g_loaded_content_build_view(GLoadedContent *, unsigned int);

/* Retrouve l'indice correspondant à la vue donnée d'un contenu. */
unsigned int g_loaded_content_get_view_index(GLoadedContent *, GtkWidget *);

/* Fournit toutes les options d'affichage pour un contenu. */
GDisplayOptions *g_loaded_content_get_display_options(const GLoadedContent *, unsigned int);



/* ----------------------- VUES ET BASCULEMENT ENTRE LES VUES ----------------------- */


/* Fournit la station d'accueil d'un panneau d'affichage. */
GtkDockStation *get_dock_station_for_view_panel(GtkWidget *);

/* Fournit le support défilant d'un panneau d'affichage. */
GtkWidget *get_scroll_window_for_view_panel(GtkWidget *);

/* Fournit le panneau chargé inclus dans un affichage. */
GtkWidget *get_loaded_panel_from_built_view(GtkWidget *);



#endif  /* _ANALYSIS_LOADED_H */