summaryrefslogtreecommitdiff
path: root/src/analysis/roptions.h
blob: 868f4f5d39eea4695ff11354f12517fa55ad15a2 (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

/* Chrysalide - Outil d'analyse de fichiers binaires
 * roptions.h - prototypes pour les options de rendus des lignes de code
 *
 * Copyright (C) 2009-2012 Cyrille Bagard
 *
 *  This file is part of Chrysalide.
 *
 *  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/>.
 */


#ifndef _ANALYSIS_ROPTIONS_H
#define _ANALYSIS_ROPTIONS_H


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


#include "../arch/processor.h"
#include "../format/executable.h"



/* Support principal de rendu */
typedef enum _MainRendering
{
    MRD_BLOCK,                              /* Unique bloc de code         */
    MRD_GRAPH,                              /* Graphique de blocs de code  */

    MRD_COUNT

} MainRendering;


/* Zone de rendu */
typedef enum _ShowingArea
{
    SAR_ADDRESS,                            /* Adresse d'une ligne         */
    SAR_CODE,                               /* Code brut d'une ligne       */
    SAR_INSTRUCTION,                        /* Instruction d'une ligne     */

    SAR_COUNT

} ShowingArea;


#define G_TYPE_RENDERING_OPTIONS               g_rendering_options_get_type()
#define G_RENDERING_OPTIONS(obj)               (G_TYPE_CHECK_INSTANCE_CAST((obj), g_rendering_options_get_type(), GRenderingOptions))
#define G_IS_RENDERING_OPTIONS(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_rendering_options_get_type()))
#define G_RENDERING_OPTIONS_GET_IFACE(inst)    (G_TYPE_INSTANCE_GET_INTERFACE((inst), g_rendering_options_get_type(), GRenderingOptionsIface))
#define G_RENDERING_OPTIONS_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_RENDERING_OPTIONS, GRenderingOptionsClass))


/* Options de représentation (instance) */
typedef struct _GRenderingOptions GRenderingOptions;

/* Options de représentation (classe) */
typedef struct _GRenderingOptionsClass GRenderingOptionsClass;


/* Indique le type défini pour des options de représentation. */
GType g_rendering_options_get_type(void);

/* Crée un un groupe d'options pour le rendu des lignes. */
GRenderingOptions *g_rendering_options_new(GExeFormat *);

/* Fournit le format du contenu binaire représenté. */
GExeFormat *g_rendering_options_get_format(const GRenderingOptions *);

/* Fournit l'architecture du contenu binaire représenté. */
GArchProcessor *g_rendering_options_get_processor(const GRenderingOptions *);

/* Fournit le style de rendu pour le contenu ASM. */
AsmSyntax g_rendering_options_get_syntax(const GRenderingOptions *);

/* Affiche (ou non) les adresses des instructions. */
void g_rendering_options_show_address(GRenderingOptions *, MainRendering, bool);

/* Indique si les adresses des instructions sont à afficher. */
bool g_rendering_options_has_to_show_address(const GRenderingOptions *, MainRendering);

/* Affiche (ou non) le code des instructions. */
void g_rendering_options_show_code(GRenderingOptions *, MainRendering, bool);

/* Indique si le code des instructions est à afficher. */
bool g_rendering_options_has_to_show_code(const GRenderingOptions *, MainRendering);



#endif  /* _ANALYSIS_ROPTIONS_H */