summaryrefslogtreecommitdiff
path: root/src/analysis/disass/dragon.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-03-26 19:56:04 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-03-26 19:56:04 (GMT)
commit9895df71ae6ea14e09478cc243227b7b3a2139a3 (patch)
tree071cd1ad6d92211e100f179bca0ea29e6ac62959 /src/analysis/disass/dragon.h
parentd07168a24ab39cad0e3cb69ed8c5e46c7a2dcdf3 (diff)
Extracted the logic of code nodes for better processing.
Diffstat (limited to 'src/analysis/disass/dragon.h')
-rw-r--r--src/analysis/disass/dragon.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/analysis/disass/dragon.h b/src/analysis/disass/dragon.h
new file mode 100644
index 0000000..c6f6fd5
--- /dev/null
+++ b/src/analysis/disass/dragon.h
@@ -0,0 +1,81 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * dragon.h - prototypes pour les capacités apportées par la lecture du livre du dragon
+ *
+ * Copyright (C) 2016 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_DISASS_DRAGON_H
+#define _ANALYSIS_DISASS_DRAGON_H
+
+
+#include "../../arch/processor.h"
+#include "../../common/bits.h"
+
+
+
+/* -------------------------- DECOUPAGES DE CODE EN NOEUDS -------------------------- */
+
+
+/* Description de noeud, en référence à "Compilers: Principles, Techniques, and Tools" */
+typedef struct _dragon_node dragon_node;
+
+
+/* Fournit les instructions bornant un noeud de code. */
+void get_dragon_node_bounding_instructions(dragon_node *, GArchInstruction **, GArchInstruction **);
+
+/* Fournit un noeud particulier à partir d'une liste. */
+dragon_node *get_dragon_node(dragon_node *, size_t);
+
+/* Fournit l'indice d'un noeud particulier à partir d'une liste. */
+size_t get_dragon_node_index(dragon_node *, dragon_node *);
+
+/* Recherche un noeud selon son intruction de départ. */
+dragon_node *find_node_for_instruction(dragon_node *, size_t, bool, const GArchInstruction *);
+
+/* Détermine toute la chaîne hiérarchique de domination. */
+void compute_all_dominators(dragon_node *, size_t);
+
+/* Fournit la liste des noeuds dominés par un noeud. */
+const bitfield_t *get_domination_bits(const dragon_node *);
+
+
+
+
+
+
+/* ---------------------------- ENCAPSULATION DES NOEUDS ---------------------------- */
+
+
+/* Concentration de tous les efforts */
+typedef struct _dragon_knight dragon_knight;
+
+
+/* Attaque la complexité d'un code en créant des noeuds. */
+dragon_knight *begin_dragon_knight(const GArchProcessor *, const instr_coverage *, const mrange_t *, const vmpa2t *);
+
+/* Supprime de la mémoire les données d'une complexité de code. */
+void end_dragon_knight(dragon_knight *);
+
+/* Fournit les éléments utiles à un traitement de blocs de code. */
+void get_dragon_knight_content(dragon_knight *, dragon_node **, size_t *);
+
+
+
+#endif /* _ANALYSIS_DISASS_DRAGON_H */