summaryrefslogtreecommitdiff
path: root/src/analysis/binary-int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/binary-int.h')
-rw-r--r--src/analysis/binary-int.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/analysis/binary-int.h b/src/analysis/binary-int.h
new file mode 100644
index 0000000..c9be0bf
--- /dev/null
+++ b/src/analysis/binary-int.h
@@ -0,0 +1,84 @@
+
+/* OpenIDA - Outil d'analyse de fichiers binaires
+ * binary-int.h - prototypes pour la définition interne des binaires
+ *
+ * Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _ANALYSIS_BINARY_INT_H
+#define _ANALYSIS_BINARY_INT_H
+
+
+#include "binary.h"
+
+
+#include "../format/format.h"
+
+
+
+/* Ecrit une sauvegarde du binaire dans un fichier XML. */
+typedef bool (* save_binary_fc) (const GLoadedBinary *, xmlDocPtr, xmlXPathContextPtr, const char *);
+
+/* Fournit le fichier correspondant à l'élément binaire. */
+typedef const char * (* get_binary_filename_fc) (const GLoadedBinary *, bool);
+
+
+/* Description de fichier binaire (instance) */
+struct _GLoadedBinary
+{
+ GObject parent; /* A laisser en premier */
+
+ save_binary_fc save; /* Sauvegarde au format XML */
+ get_binary_filename_fc get_filename; /* Obtention d'une description */
+
+ off_t bin_length; /* Taille des données brutes */
+ bin_t *bin_data; /* Données binaires brutes */
+
+ GExeFormat *format; /* Format du binaire */
+ GArchProcessor *proc; /* Architecture du binaire */
+
+ BinaryPartModel model; /* Modèle de sélection */
+ GBinPart **parts[BPM_COUNT]; /* Parties binaires à analyser */
+ size_t parts_count[BPM_COUNT]; /* Quantité de ces parties */
+
+ GArchInstruction *instrs; /* Instructions d'assemblage */
+ GCodeBuffer *disass_buffer; /* Instructions lisibles */
+ GCodeBuffer **dec_buffers; /* Sources sous forme de texte */
+ size_t decbuf_count; /* Taille des tableaux */
+ size_t defsrc; /* Fichier source principal */
+
+ bool text_display[2]; /* Position et code binaire #1 */
+ bool lines_display; /* Affichage des lignes */
+
+};
+
+/* Description de fichier binaire (classe) */
+struct _GLoadedBinaryClass
+{
+ GObjectClass parent; /* A laisser en premier */
+
+ /* Signaux */
+
+ void (* disassembly_done) (GLoadedBinary *);
+
+};
+
+
+
+#endif /* _ANALYSIS_BINARY_INT_H */