summaryrefslogtreecommitdiff
path: root/src/analysis/disass/area.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-12-30 08:25:05 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-12-30 08:25:05 (GMT)
commit57d7eff57c20e75aaa4ccd34f1d9d733e12bb232 (patch)
treea60199f7323a31e0bf22b8f8747fdf402f2c481d /src/analysis/disass/area.h
parent19e1a97fafb1b73d0efcd995b31951daf1a5c661 (diff)
Tracked each binary area during the disassembling process and tried to follow the execution flow.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@445 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/disass/area.h')
-rw-r--r--src/analysis/disass/area.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/analysis/disass/area.h b/src/analysis/disass/area.h
new file mode 100644
index 0000000..58539ca
--- /dev/null
+++ b/src/analysis/disass/area.h
@@ -0,0 +1,96 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * area.h - prototypes pour la définition et la manipulation des aires à désassembler
+ *
+ * Copyright (C) 2014 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_AREA_H
+#define _ANALYSIS_DISASS_AREA_H
+
+
+#include "../binary.h"
+#include "../../format/executable.h"
+#include "../../gtkext/gtkextstatusbar.h"
+
+
+//////
+#include "../../arch/raw.h"
+#include "../../arch/instruction.h"
+
+
+
+/* Zone mémoire bien bornée */
+typedef struct _mem_area
+{
+ mrange_t range; /* Couverture de la zone */
+
+ unsigned long *processed; /* Octets traités dans la zone */
+ GArchInstruction **instructions; /* Instructions en place */
+
+ bool has_sym; /* Représentation via symbole ?*/
+
+ union
+ {
+ bool exec; /* Zone exécutable ? */
+ GBinSymbol *symbol; /* Symbole associé à la zone */
+ };
+
+} mem_area;
+
+
+
+
+/* Zone mémoire bien bornée */
+//typedef struct _mem_area mem_area;
+
+
+
+
+/* Procède au désassemblage d'un contenu binaire exécutable. */
+void load_code_from_mem_area(mem_area *, mem_area *, size_t, const GLoadedBinary *, GProcContext *, const vmpa2t *, status_info *);
+
+
+
+/* Détermine une liste de zones contigües à traiter. */
+mem_area *compute_memory_areas(GExeFormat *, phys_t, size_t *);
+
+
+
+
+
+
+
+
+
+/* Détermine une liste de zones contigües à traiter. */
+mem_area *find_memory_area_by_addr(mem_area *, size_t, const vmpa2t *);
+
+
+
+
+/* S'assure que l'ensemble des aires est entièrement décodé. */
+void ensure_all_mem_areas_are_filled(mem_area *, size_t, const GLoadedBinary *, GProcContext *, status_info *);
+
+/* Rassemble les instructions conservées dans des zones données. */
+GArchInstruction *collect_instructions_from_mem_areas(mem_area *, size_t);
+
+
+
+#endif /* _ANALYSIS_DISASS_AREA_H */