summaryrefslogtreecommitdiff
path: root/plugins/dalvik/context.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-10-18 20:50:10 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-10-18 20:50:10 (GMT)
commitdce9d9cdfef1d37ef11a987a21f36e83b6b1944f (patch)
tree830623ade20e892954fcbddd3b7b05d09aac1dd7 /plugins/dalvik/context.h
parent1e7c7de85438749d3faf7b76984b86a9c088fbc1 (diff)
Created plugins for the Dex and Dalvik support.
Diffstat (limited to 'plugins/dalvik/context.h')
-rw-r--r--plugins/dalvik/context.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/plugins/dalvik/context.h b/plugins/dalvik/context.h
new file mode 100644
index 0000000..fbee9e0
--- /dev/null
+++ b/plugins/dalvik/context.h
@@ -0,0 +1,102 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * context.h - prototypes pour le contexte lié à l'exécution d'un processeur
+ *
+ * Copyright (C) 2011-2017 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 Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _ARCH_DALVIK_CONTEXT_H
+#define _ARCH_DALVIK_CONTEXT_H
+
+
+#include <glib-object.h>
+#include <stdbool.h>
+
+
+#include <arch/archbase.h>
+
+
+#include "instruction.h"
+
+
+
+/* ------------------------ MANIPULATION GLOBALE DU CONTEXTE ------------------------ */
+
+
+#define G_TYPE_DALVIK_CONTEXT g_dalvik_context_get_type()
+#define G_DALVIK_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_dalvik_context_get_type(), GDalvikContext))
+#define G_IS_DALVIK_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_dalvik_context_get_type()))
+#define G_DALVIK_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DALVIK_CONTEXT, GGDalvikContextClass))
+#define G_IS_DALVIK_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DALVIK_CONTEXT))
+#define G_DALVIK_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DALVIK_CONTEXT, GGDalvikContextClass))
+
+
+/* Définition d'un contexte pour processeur Dalkvik (instance) */
+typedef struct _GDalvikContext GDalvikContext;
+
+/* Définition d'un contexte pour processeur Dalkvik (classe) */
+typedef struct _GDalvikContextClass GDalvikContextClass;
+
+
+/* Indique le type définit par la GLib pour le contexte de processeur Dalkvik. */
+GType g_dalvik_context_get_type(void);
+
+/* Crée un contexte pour l'exécution du processeur Dalvik. */
+GDalvikContext *g_dalvik_context_new(void);
+
+/* Mémorise une zone comme étant des données de branchements. */
+bool g_dalvik_context_register_switch_data(GDalvikContext *ctx, const vmpa2t *start, phys_t length);
+
+/* Mémorise une zone comme étant des données d'un tableau. */
+bool g_dalvik_context_register_array_data(GDalvikContext *, const vmpa2t *, uint16_t, phys_t);
+
+/* Place une donnée en tant qu'instruction si besoin est. */
+GArchInstruction *g_dalvik_context_get_raw_data(GDalvikContext *, const GBinContent *, vmpa2t *);
+
+
+
+/* ------------------------- CONTEXTE POUR LA DECOMPILATION ------------------------- */
+
+
+#if 0
+#define G_TYPE_DALVIK_DCONTEXT g_dalvik_dcontext_get_type()
+#define G_DALVIK_DCONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_dalvik_dcontext_get_type(), GDalvikDContext))
+#define G_IS_DALVIK_DCONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_dalvik_dcontext_get_type()))
+#define G_DALVIK_DCONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DALVIK_DCONTEXT, GGDalvikDContextClass))
+#define G_IS_DALVIK_DCONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DALVIK_DCONTEXT))
+#define G_DALVIK_DCONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DALVIK_DCONTEXT, GGDalvikDContextClass))
+
+
+/* Définition d'un contexte pour décompilation Dalkvik (instance) */
+typedef struct _GDalvikDContext GDalvikDContext;
+
+/* Définition d'un contexte pour décompilation Dalkvik (classe) */
+typedef struct _GDalvikDContextClass GDalvikDContextClass;
+
+
+/* Indique le type définit par la GLib pour le contexte de décompilation Dalkvik. */
+GType g_dalvik_dcontext_get_type(void);
+
+/* Crée un contexte pour la décompilation Dalvik. */
+GDalvikDContext *g_dalvik_dcontext_new(void);
+#endif
+
+
+
+#endif /* _ARCH_DALVIK_CONTEXT_H */