summaryrefslogtreecommitdiff
path: root/src/decomp
diff options
context:
space:
mode:
Diffstat (limited to 'src/decomp')
-rwxr-xr-xsrc/decomp/Makefile.am26
-rw-r--r--src/decomp/context-int.h86
-rw-r--r--src/decomp/context.c491
-rw-r--r--src/decomp/context.h104
-rw-r--r--src/decomp/expr/Makefile.am28
-rw-r--r--src/decomp/expr/access.c249
-rw-r--r--src/decomp/expr/access.h60
-rw-r--r--src/decomp/expr/arithm.c286
-rw-r--r--src/decomp/expr/arithm.h76
-rw-r--r--src/decomp/expr/array.c251
-rw-r--r--src/decomp/expr/array.h61
-rw-r--r--src/decomp/expr/assign.c287
-rw-r--r--src/decomp/expr/assign.h66
-rw-r--r--src/decomp/expr/block.c395
-rw-r--r--src/decomp/expr/block.h84
-rw-r--r--src/decomp/expr/call.c290
-rw-r--r--src/decomp/expr/call.h64
-rw-r--r--src/decomp/expr/comp.c311
-rw-r--r--src/decomp/expr/comp.h60
-rw-r--r--src/decomp/expr/cond.c461
-rw-r--r--src/decomp/expr/cond.h72
-rw-r--r--src/decomp/expr/dalvik/Makefile.am12
-rw-r--r--src/decomp/expr/dalvik/array.c155
-rw-r--r--src/decomp/expr/dalvik/array.h61
-rw-r--r--src/decomp/expr/immediate.c153
-rw-r--r--src/decomp/expr/immediate.h61
-rw-r--r--src/decomp/expr/pseudo.c253
-rw-r--r--src/decomp/expr/pseudo.h83
-rw-r--r--src/decomp/expr/return.c243
-rw-r--r--src/decomp/expr/return.h60
-rw-r--r--src/decomp/expr/text.c159
-rw-r--r--src/decomp/expr/text.h60
-rw-r--r--src/decomp/expression-int.h57
-rw-r--r--src/decomp/expression.c137
-rw-r--r--src/decomp/expression.h56
-rw-r--r--src/decomp/instr/Makefile.am18
-rw-r--r--src/decomp/instr/ite.c339
-rw-r--r--src/decomp/instr/ite.h70
-rw-r--r--src/decomp/instr/keyword.c162
-rw-r--r--src/decomp/instr/keyword.h68
-rw-r--r--src/decomp/instr/switch.c380
-rw-r--r--src/decomp/instr/switch.h66
-rw-r--r--src/decomp/instruction-int.h77
-rw-r--r--src/decomp/instruction.c267
-rw-r--r--src/decomp/instruction.h98
-rwxr-xr-xsrc/decomp/lang/Makefile.am13
-rw-r--r--src/decomp/lang/asm.c298
-rw-r--r--src/decomp/lang/asm.h55
-rw-r--r--src/decomp/lang/java.c652
-rw-r--r--src/decomp/lang/java.h55
-rw-r--r--src/decomp/output-int.h106
-rw-r--r--src/decomp/output.c483
-rw-r--r--src/decomp/output.h134
53 files changed, 0 insertions, 8699 deletions
diff --git a/src/decomp/Makefile.am b/src/decomp/Makefile.am
deleted file mode 100755
index 0d1bf83..0000000
--- a/src/decomp/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-
-noinst_LTLIBRARIES = libdecomp.la
-
-libdecomp_la_SOURCES = \
- context-int.h \
- context.h context.c \
- expression-int.h \
- expression.h expression.c \
- instruction-int.h \
- instruction.h instruction.c \
- output-int.h \
- output.h output.c
-
-libdecomp_la_LIBADD = \
- expr/libdecompexpr.la \
- instr/libdecompinstr.la \
- lang/libdecomplang.la
-
-libdecomp_la_LDFLAGS =
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-
-SUBDIRS = expr instr lang
diff --git a/src/decomp/context-int.h b/src/decomp/context-int.h
deleted file mode 100644
index 582e739..0000000
--- a/src/decomp/context-int.h
+++ /dev/null
@@ -1,86 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * context.c - mise en place d'un contexte de décompilation
- *
- * Copyright (C) 2012-2013 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 _DECOMP_CONTEXT_INT_H
-#define _DECOMP_CONTEXT_INT_H
-
-
-#include "context.h"
-
-
-#include "../analysis/routine.h"
-#include "../glibext/gnhash.h"
-
-
-
-/* Duplique un contexte de compilation. */
-typedef GDecContext * (* dup_dec_context_fc) (GDecContext *);
-
-/* Propage un registre alloué et attendu par la suite. */
-typedef void (* spread_reg_fc) (GDecContext *, GArchRegister *, GDecInstruction *);
-
-/* Convertit un registre machine en un pseudo-registre. */
-typedef GDecInstruction * (* convert_register_fc) (GDecContext *, gpointer, bool, vmpa_t);
-
-
-
-/* Définition d'une context décompilée (instance) */
-struct _GDecContext
-{
- GObject parent; /* A laisser en premier */
-
- dup_dec_context_fc dup; /* Duplication de contexte */
- spread_reg_fc spread; /* Propagation des allocations */
- convert_register_fc convert_reg; /* Traduction des registres */
-
- GExeFormat *format; /* Format binaire concerné */
- GBinRoutine *routine; /* Routine visée par l'opérat° */
-
- GRAccessList *awaited; /* Allocations attendues */
- GHashTable *shared; /* Allocations à propager */
-
- GDecInstruction *list; /* Chaîne décompilée */
-
-};
-
-
-/* Définition d'une context décompilée (classe) */
-struct _GDecContextClass
-{
- GObjectClass parent; /* A laisser en premier */
-
-};
-
-
-/* Duplique partiellement un contexte de compilation. */
-void _g_dec_context_dup(GDecContext *, GDecContext *);
-
-/* Sauvegarde une conversion de registre si elle est attendue. */
-void g_dec_context_notify_reg_alloc(GDecContext *, GArchRegister *, GDecInstruction *, vmpa_t);
-
-/* Fournit une conversiond de registre déjà faite et attendue. */
-GDecInstruction *g_dec_context_get_awaited_alloc(GDecContext *, GArchRegister *, vmpa_t);
-
-
-
-#endif /* _DECOMP_CONTEXT_INT_H */
diff --git a/src/decomp/context.c b/src/decomp/context.c
deleted file mode 100644
index 371cfc9..0000000
--- a/src/decomp/context.c
+++ /dev/null
@@ -1,491 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * context.c - mise en place d'un contexte de décompilation
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "context.h"
-
-
-#include <malloc.h>
-
-
-#include "context-int.h"
-#include "instruction-int.h"
-#include "../arch/operand.h"
-
-
-
-/* Initialise la classe des contextes de décompilation. */
-static void g_dec_context_class_init(GDecContextClass *);
-
-/* Initialise une instance de contexte de décompilation. */
-static void g_dec_context_init(GDecContext *);
-
-/* Supprime toutes les références externes. */
-static void g_dec_context_dispose(GDecContext *);
-
-/* Procède à la libération totale de la mémoire. */
-static void g_dec_context_finalize(GDecContext *);
-
-
-
-/* Indique le type défini pour un contexte de décompilation. */
-G_DEFINE_TYPE(GDecContext, g_dec_context, G_TYPE_OBJECT);
-
-
-/******************************************************************************
-* *
-* Paramètres : class = classe à initialiser. *
-* *
-* Description : Initialise la classe des contextes de décompilation. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dec_context_class_init(GDecContextClass *class)
-{
- GObjectClass *object; /* Autre version de la classe */
-
- object = G_OBJECT_CLASS(class);
-
- object->dispose = (GObjectFinalizeFunc/* ! */)g_dec_context_dispose;
- object->finalize = (GObjectFinalizeFunc)g_dec_context_finalize;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à initialiser. *
-* *
-* Description : Initialise une instance de contexte de décompilation. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dec_context_init(GDecContext *ctx)
-{
- ctx->awaited = g_raccess_list_new();
-
- ctx->shared = g_hash_table_new_full((GHashFunc)g_arch_register_hash,
- (GEqualFunc)g_arch_register_equal,
- g_object_unref, g_object_unref);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance d'objet GLib à traiter. *
-* *
-* Description : Supprime toutes les références externes. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dec_context_dispose(GDecContext *ctx)
-{
- if (ctx->format != NULL)
- g_object_unref(G_OBJECT(ctx->format));
-
- if (ctx->routine != NULL)
- g_object_unref(G_OBJECT(ctx->routine));
-
- g_object_unref(G_OBJECT(ctx->awaited));
- g_hash_table_unref(ctx->shared);
-
- G_OBJECT_CLASS(g_dec_context_parent_class)->dispose(G_OBJECT(ctx));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance d'objet GLib à traiter. *
-* *
-* Description : Procède à la libération totale de la mémoire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dec_context_finalize(GDecContext *ctx)
-{
- G_OBJECT_CLASS(g_dec_context_parent_class)->finalize(G_OBJECT(ctx));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : dest = contexte de compilation à définir. *
-* src = contexte de compilation à copier. *
-* *
-* Description : Duplique partiellement un contexte de compilation. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void _g_dec_context_dup(GDecContext *dest, GDecContext *src)
-{
- if (src->routine != NULL)
- g_object_ref(G_OBJECT(src->routine));
- if (src->format != NULL)
- g_object_ref(G_OBJECT(src->format));
-
- dest->routine = src->routine;
- dest->format = src->format;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : orig = contexte de compilation à copier. *
-* *
-* Description : Duplique un contexte de compilation. *
-* *
-* Retour : Contexte de décompilation prêt à emploi. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecContext *g_dec_context_dup(GDecContext *orig)
-{
- GDecContext *result; /* Instance à retourner */
-
- result = orig->dup(orig);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = contexte de décompilation à compléter. *
-* routine = routine visée par l'opération. *
-* format = format du fichier binaire associé. *
-* *
-* Description : Définit les informations essentielles à la décompilation. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_context_set_info(GDecContext *ctx, GBinRoutine *routine, GExeFormat *format)
-{
- g_object_ref(G_OBJECT(routine));
- g_object_ref(G_OBJECT(format));
-
- ctx->routine = routine;
- ctx->format = format;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à consulter. *
-* *
-* Description : Fournit le format binaire associé au contexte. *
-* *
-* Retour : Format du fichier binaire décompilé. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GExeFormat *g_dec_context_get_format(const GDecContext *ctx)
-{
- return ctx->format;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à mettre à jour. *
-* awaited = liste des registres impliqués dans plusieurs blocs.*
-* *
-* Description : Définit la liste des registrés utilisés dans plusieurs blocs.*
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_context_set_awaited(GDecContext *ctx, GRAccessList *awaited)
-{
- g_object_unref(G_OBJECT(ctx->awaited));
-
- g_object_ref(G_OBJECT(awaited));
- ctx->awaited = awaited;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à consulter. *
-* *
-* Description : Fournit la liste des registrés utilisés dans plusieurs blocs.*
-* *
-* Retour : Liste des registres impliqués dans plusieurs blocs. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-const GRAccessList *g_dec_context_get_awaited(const GDecContext *ctx)
-{
- return ctx->awaited;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à mettre à jour. *
-* shared = liste des allocations passées de registres attendus.*
-* *
-* Description : Définit la liste des registrés déjà alloués et attendus. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_context_set_shared_allocs(GDecContext *ctx, GHashTable *shared)
-{
- g_hash_table_unref(ctx->shared);
-
- g_hash_table_ref(shared);
- ctx->shared = shared;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à consulter. *
-* *
-* Description : Fournit la liste des registrés déjà alloués et attendus. *
-* *
-* Retour : Liste des allocations passées de registres attendus. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GHashTable *g_dec_context_get_shared_allocs(const GDecContext *ctx)
-{
- return ctx->shared;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : parent = instance à éventuellement compléter. *
-* child = instance à venir consulter. *
-* *
-* Description : Propage les registres alloués et attendus par la suite. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_context_spread_allocated_shared_regs(GDecContext *parent, GDecContext *child)
-{
- GHashTableIter iter; /* Boucle de parcours */
- GArchRegister *reg; /* Registre converti */
- GDecInstruction *dinstr; /* Expression décompilée */
-
- g_hash_table_iter_init(&iter, child->shared);
-
- while (g_hash_table_iter_next(&iter, (gpointer *)&reg, (gpointer *)&dinstr))
- {
- /**
- * La liste des allocations attendues du bloc virtuel parent, et donc de
- * son contexte associé, englobe les attentes des blocs contenus.
- * Même si ce bloc parent n'est pas responsable directement de ces allocations,
- * on fait remonter ces dernières pour la propagation dans les blocs suivants
- * le bloc parent.
- */
- if (g_raccess_list_find(parent->awaited, reg) != NULL)
- {
- g_object_ref(G_OBJECT(reg));
- g_object_ref(G_OBJECT(dinstr));
-
- g_hash_table_insert(parent->shared, reg, dinstr);
-
- }
-
- parent->spread(parent, reg, dinstr);
-
- }
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à consulter. *
-* *
-* Description : Fournit le premier élément de la liste des instructions. *
-* *
-* Retour : Première instruction décompilée pour le contexte. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_dec_context_get_decomp_instrs(const GDecContext *ctx)
-{
- return ctx->list;
-
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à mettre à jour. *
-* instr = première instruction décompilée pour le contexte. *
-* *
-* Description : Met à jour le premier élément de la liste des instructions. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_context_set_decomp_instrs(GDecContext *ctx, GDecInstruction *instr)
-{
- ctx->list = instr;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à consulter, voire mettre à jour. *
-* operand = opérande représentant un registre quelconque. *
-* assign = précise le sort prochain du registre. *
-* addr = adresse de l'instruction décompilée. *
-* *
-* Description : Convertit un registre machine en un pseudo-registre. *
-* *
-* Retour : Pseudo-registre, existant ou non, prêt à emploi. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_dec_context_convert_register(GDecContext *ctx, gpointer operand, bool assign, vmpa_t addr)
-{
- return ctx->convert_reg(ctx, operand, assign, addr);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à consulter, voire mettre à jour. *
-* reg = registre à l'origine de l'allocation. *
-* dinstr = élément décompilé résultant. *
-* addr = adresse de l'instruction décompilée. *
-* *
-* Description : Sauvegarde une conversion de registre si elle est attendue. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_context_notify_reg_alloc(GDecContext *ctx, GArchRegister *reg, GDecInstruction *dinstr, vmpa_t addr)
-{
- reg_access *access; /* Attente rélle si existante */
-
- access = g_raccess_list_find(ctx->awaited, reg);
-
- if (access != NULL && access->last_write == addr)
- {
- g_object_ref(G_OBJECT(reg));
- g_object_ref(G_OBJECT(dinstr));
-
- g_hash_table_insert(ctx->shared, reg, dinstr);
-
- }
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ctx = instance à consulter, voire mettre à jour. *
-* reg = registre à convertir prochainement. *
-* addr = adresse de l'instruction décompilée. *
-* *
-* Description : Fournit une conversiond de registre déjà faite et attendue. *
-* *
-* Retour : Elément déjà décompilé dans une autre branche. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_dec_context_get_awaited_alloc(GDecContext *ctx, GArchRegister *reg, vmpa_t addr)
-{
- reg_access *access; /* Attente rélle si existante */
-
- access = g_raccess_list_find(ctx->awaited, reg);
- if (access == NULL) return NULL;
-
- if (access->last_write != addr) return NULL;
-
- return G_DEC_INSTRUCTION(g_hash_table_lookup(ctx->shared, reg));
-
-}
diff --git a/src/decomp/context.h b/src/decomp/context.h
deleted file mode 100644
index 1bfb2d3..0000000
--- a/src/decomp/context.h
+++ /dev/null
@@ -1,104 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * context.h - prototypes pour la mise en place d'un contexte de décompilation
- *
- * Copyright (C) 2010-2013 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 _DECOMP_CONTEXT_H
-#define _DECOMP_CONTEXT_H
-
-
-#include <glib-object.h>
-
-
-#include "instruction.h"
-#include "../arch/archbase.h"
-#include "../format/executable.h"
-#include "../analysis/blocks/raccess.h"
-
-
-/**
- * Impossible d'inclure directement :
- * - ../analysis/routine.h, qui inclut ../arch/instruction.h.
- * - ../arch/instruction.h, qui inclut ce fichier.
- *
- * On redéclare donc manuellement les types manquants.
- */
-
-/* "../analysis/routine.h" : Représentation générique de routine (instance) */
-typedef struct _GBinRoutine GBinRoutine;
-
-
-
-#define G_TYPE_DEC_CONTEXT g_dec_context_get_type()
-#define G_DEC_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_dec_context_get_type(), GDecContext))
-#define G_IS_DEC_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_dec_context_get_type()))
-#define G_DEC_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DEC_CONTEXT, GDecContextClass))
-#define G_IS_DEC_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DEC_CONTEXT))
-#define G_DEC_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DEC_CONTEXT, GDecContextClass))
-
-
-
-/* Définition d'un contexte de décompilation (instance) */
-typedef struct _GDecContext GDecContext;
-
-/* Définition d'un contexte de décompilation (classe) */
-typedef struct _GDecContextClass GDecContextClass;
-
-
-/* Indique le type défini pour un contexte de décompilation. */
-GType g_dec_context_get_type(void);
-
-/* Duplique un contexte de compilation. */
-GDecContext *g_dec_context_dup(GDecContext *);
-
-/* Définit les informations essentielles à la décompilation. */
-void g_dec_context_set_info(GDecContext *, GBinRoutine *, GExeFormat *);
-
-/* Fournit le format binaire associé au contexte. */
-GExeFormat *g_dec_context_get_format(const GDecContext *);
-
-/* Définit la liste des registrés utilisés dans plusieurs blocs. */
-void g_dec_context_set_awaited(GDecContext *, GRAccessList *);
-
-/* Fournit la liste des registrés utilisés dans plusieurs blocs. */
-const GRAccessList *g_dec_context_get_awaited(const GDecContext *);
-
-/* Définit la liste des registrés déjà alloués et attendus. */
-void g_dec_context_set_shared_allocs(GDecContext *, GHashTable *);
-
-/* Fournit la liste des registrés déjà alloués et attendus. */
-GHashTable *g_dec_context_get_shared_allocs(const GDecContext *);
-
-/* Propage les registres alloués et attendus par la suite. */
-void g_dec_context_spread_allocated_shared_regs(GDecContext *, GDecContext *);
-
-/* Fournit le premier élément de la liste des instructions. */
-GDecInstruction *g_dec_context_get_decomp_instrs(const GDecContext *tx);
-
-/* Met à jour le premier élément de la liste des instructions. */
-void g_dec_context_set_decomp_instrs(GDecContext *, GDecInstruction *);
-
-/* Convertit un registre machine en un pseudo-registre. */
-GDecInstruction *g_dec_context_convert_register(GDecContext *, gpointer, bool, vmpa_t);
-
-
-
-#endif /* _DECOMP_CONTEXT_H */
diff --git a/src/decomp/expr/Makefile.am b/src/decomp/expr/Makefile.am
deleted file mode 100644
index 665c3f7..0000000
--- a/src/decomp/expr/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-
-noinst_LTLIBRARIES = libdecompexpr.la
-
-libdecompexpr_la_SOURCES = \
- access.h access.c \
- arithm.h arithm.c \
- array.h array.c \
- assign.h assign.c \
- block.h block.c \
- call.h call.c \
- comp.h comp.c \
- cond.h cond.c \
- immediate.h immediate.c \
- pseudo.h pseudo.c \
- return.h return.c \
- text.h text.c
-
-libdecompexpr_la_LDFLAGS =
-
-libdecompexpr_la_LIBADD = \
- dalvik/libdecompexprdalvik.la
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-
-SUBDIRS = dalvik
diff --git a/src/decomp/expr/access.c b/src/decomp/expr/access.c
deleted file mode 100644
index b16ee36..0000000
--- a/src/decomp/expr/access.c
+++ /dev/null
@@ -1,249 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * access.c - représentation des accès à des éléments d'entités
- *
- * Copyright (C) 2012-2013 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/>.
- */
-
-
-#include "access.h"
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'un accès quelconque (instance) */
-struct _GAccessExpression
-{
- GDecExpression parent; /* A laisser en premier */
-
- GDecExpression *owner; /* Destination de l'accessat° */
- GDecExpression *target; /* Source de l'accessation */
-
-};
-
-
-/* Définition d'un accès quelconque (classe) */
-struct _GAccessExpressionClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des accessations quelconques. */
-static void g_access_expression_class_init(GAccessExpressionClass *);
-
-/* Initialise une instance d'accessation quelconque. */
-static void g_access_expression_init(GAccessExpression *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_access_expression_visit(GAccessExpression *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_access_expression_replace(GAccessExpression *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_access_expression_print(const GAccessExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un accès quelconque. */
-G_DEFINE_TYPE(GAccessExpression, g_access_expression, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des accessations quelconques. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_access_expression_class_init(GAccessExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'accessation quelconque. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_access_expression_init(GAccessExpression *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->visit = (dec_instr_visit_fc)g_access_expression_visit;
- instr->replace = (dec_instr_replace_fc)g_access_expression_replace;
- instr->print = (dec_instr_print_fc)g_access_expression_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : owner = entité qui accueille la cible accédée. *
-* target = élément du propriétaire auquel on accède. *
-* *
-* Description : Représente l'accès à un élément d'une entité. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_access_expression_new(GDecExpression *owner, GDecExpression *target)
-{
- GAccessExpression *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_ACCESS_EXPRESSION, NULL);
-
- result->owner = owner;
- result->target = target;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_access_expression_visit(GAccessExpression *expr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
-
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->owner), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- if (result)
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->target), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_access_expression_replace(GAccessExpression *expr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
-
- if (expr->owner == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->owner));
- g_object_ref(G_OBJECT(new));
- expr->owner = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result = g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->owner), old, new);
-
- if (expr->target == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->target));
- g_object_ref(G_OBJECT(new));
- expr->target = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result |= g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->target), old, new);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_access_expression_print(const GAccessExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->owner),
- buffer, line, output);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, ".", 3, RTT_PUNCT, NULL);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->target),
- buffer, result, output);
-
- return result;
-
-}
diff --git a/src/decomp/expr/access.h b/src/decomp/expr/access.h
deleted file mode 100644
index 220de07..0000000
--- a/src/decomp/expr/access.h
+++ /dev/null
@@ -1,60 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * access.h - prototypes pour la représentation des accès à des éléments d'entités
- *
- * Copyright (C) 2012 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 _DECOMP_EXPR_ACCESS_H
-#define _DECOMP_EXPR_ACCESS_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../instruction.h"
-
-
-
-#define G_TYPE_ACCESS_EXPRESSION g_access_expression_get_type()
-#define G_ACCESS_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_access_expression_get_type(), GAccessExpression))
-#define G_IS_ACCESS_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_access_expression_get_type()))
-#define G_ACCESS_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ACCESS_EXPRESSION, GAccessExpressionClass))
-#define G_IS_ACCESS_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ACCESS_EXPRESSION))
-#define G_ACCESS_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ACCESS_EXPRESSION, GAccessExpressionClass))
-
-
-
-/* Définition d'un accès quelconque (instance) */
-typedef struct _GAccessExpression GAccessExpression;
-
-/* Définition d'un accès quelconque (classe) */
-typedef struct _GAccessExpressionClass GAccessExpressionClass;
-
-
-/* Indique le type défini pour un accès quelconque. */
-GType g_access_expression_get_type(void);
-
-/* Représente l'accès à un élément d'une entité. */
-GDecInstruction *g_access_expression_new(GDecExpression *, GDecExpression *);
-
-
-
-#endif /* _DECOMP_EXPR_ACCESS_H */
diff --git a/src/decomp/expr/arithm.c b/src/decomp/expr/arithm.c
deleted file mode 100644
index 8944596..0000000
--- a/src/decomp/expr/arithm.c
+++ /dev/null
@@ -1,286 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * arithm.c - représentation des opérations arithmétiques
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "arithm.h"
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'une opération arithmétique définie (instance) */
-struct _GArithmExpression
-{
- GDecExpression parent; /* A laisser en premier */
-
- GDecExpression *op1; /* Premier opérande manipulé */
- GDecExpression *op2; /* Second opérande manipulé */
-
- ArithmOperationType type; /* Opération à représenter */
-
-};
-
-
-/* Définition d'une opération arithmétique définie (classe) */
-struct _GArithmExpressionClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des opérations arithmétiques définies. */
-static void g_arithm_expression_class_init(GArithmExpressionClass *);
-
-/* Initialise une instance d'opération arithmétique définie. */
-static void g_arithm_expression_init(GArithmExpression *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_arithm_expression_visit(GArithmExpression *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_arithm_expression_replace(GArithmExpression *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_arithm_expression_print(const GArithmExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour une opération arithmétique définie. */
-G_DEFINE_TYPE(GArithmExpression, g_arithm_expression, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des opérations arithmétiques définies. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_arithm_expression_class_init(GArithmExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'opération arithmétique définie. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_arithm_expression_init(GArithmExpression *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->visit = (dec_instr_visit_fc)g_arithm_expression_visit;
- instr->replace = (dec_instr_replace_fc)g_arithm_expression_replace;
- instr->print = (dec_instr_print_fc)g_arithm_expression_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : op1 = premier opérande à manipuler. *
-* type = type d'opération à mener ici. *
-* op2 = seconde opérande à manipuler. *
-* *
-* Description : Représente une opération arithmétique entre deux opérandes. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_arithm_expression_new(GDecExpression *op1, ArithmOperationType type, GDecExpression *op2)
-{
- GArithmExpression *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_ARITHM_EXPRESSION, NULL);
-
- result->op1 = op1;
- result->op2 = op2;
-
- result->type = type;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_arithm_expression_visit(GArithmExpression *expr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
-
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->op1), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- if (result)
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->op2), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_arithm_expression_replace(GArithmExpression *expr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
-
- if (expr->op1 == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->op1));
- g_object_ref(G_OBJECT(new));
- expr->op1 = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result = g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->op1), old, new);
-
- if (expr->op2 == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->op2));
- g_object_ref(G_OBJECT(new));
- expr->op2 = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result |= g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->op2), old, new);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_arithm_expression_print(const GArithmExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
- const char *sign; /* Symbole de l'opération */
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->op1),
- buffer, line, output);
-
- switch (expr->type)
- {
- case AOT_ADD:
- sign = " + ";
- break;
- case AOT_SUB:
- sign = " - ";
- break;
- case AOT_MUL:
- sign = " * ";
- break;
- case AOT_DIV:
- sign = " / ";
- break;
- case AOT_REM:
- sign = " % ";
- break;
- case AOT_AND:
- sign = " & ";
- break;
- case AOT_OR:
- sign = " | ";
- break;
- case AOT_XOR:
- sign = " ^ ";
- break;
- default: /* AOT_COUNT */
- sign = " ? ";
- break;
- }
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, sign, 3, RTT_SIGNS, NULL);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->op2),
- buffer, result, output);
-
- return result;
-
-}
diff --git a/src/decomp/expr/arithm.h b/src/decomp/expr/arithm.h
deleted file mode 100644
index 47aac7f..0000000
--- a/src/decomp/expr/arithm.h
+++ /dev/null
@@ -1,76 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * arithm.h - prototypes pour la représentation des opérations arithmétiques
- *
- * Copyright (C) 2010 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 _ANALYSIS_DECOMP_COMMON_ARITHM_H
-#define _ANALYSIS_DECOMP_COMMON_ARITHM_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../instruction.h"
-
-
-
-#define G_TYPE_ARITHM_EXPRESSION g_arithm_expression_get_type()
-#define G_ARITHM_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_arithm_expression_get_type(), GArithmExpression))
-#define G_IS_ARITHM_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_arithm_expression_get_type()))
-#define G_ARITHM_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ARITHM_EXPRESSION, GArithmExpressionClass))
-#define G_IS_ARITHM_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ARITHM_EXPRESSION))
-#define G_ARITHM_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ARITHM_EXPRESSION, GArithmExpressionClass))
-
-
-/* Définition d'une opération arithmétique définie (instance) */
-typedef struct _GArithmExpression GArithmExpression;
-
-/* Définition d'une opération arithmétique définie (classe) */
-typedef struct _GArithmExpressionClass GArithmExpressionClass;
-
-
-/* Types d'opérations menables */
-typedef enum _ArithmOperationType
-{
- AOT_ADD, /* Addition */
- AOT_SUB, /* Soustraction */
- AOT_MUL, /* Multiplication */
- AOT_DIV, /* Division */
- AOT_REM, /* Modulo */
- AOT_AND, /* Et logique */
- AOT_OR, /* Ou logique */
- AOT_XOR, /* Ou exclusif */
-
- AOT_COUNT
-
-} ArithmOperationType;
-
-
-/* Indique le type défini pour une opération arithmétique définie. */
-GType g_arithm_expression_get_type(void);
-
-/* Représente une opération arithmétique entre deux opérandes. */
-GDecInstruction *g_arithm_expression_new(GDecExpression *, ArithmOperationType, GDecExpression *);
-
-
-
-#endif /* _ANALYSIS_DECOMP_COMMON_ARITHM_H */
diff --git a/src/decomp/expr/array.c b/src/decomp/expr/array.c
deleted file mode 100644
index a78405e..0000000
--- a/src/decomp/expr/array.c
+++ /dev/null
@@ -1,251 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * array.c - manipulations de tableaux génériques
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "array.h"
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'un accès à une cellule de tableau (instance) */
-struct _GArrayAccess
-{
- GDecExpression parent; /* A laisser en premier */
-
- GDecExpression *array; /* Elément auquel accéder */
- GDecExpression *index; /* Position de la cellule */
-
-};
-
-
-/* Définition d'un accès à une cellule de tableau (classe) */
-struct _GArrayAccessClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des accès aux cellules de tableau. */
-static void g_array_access_class_init(GArrayAccessClass *);
-
-/* Initialise une instance d'accès à une cellule de tableau. */
-static void g_array_access_init(GArrayAccess *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_array_access_visit(GArrayAccess *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_array_access_replace(GArrayAccess *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_array_access_print(const GArrayAccess *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un accès à une cellule de tableau. */
-G_DEFINE_TYPE(GArrayAccess, g_array_access, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des accès aux cellules de tableau. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_array_access_class_init(GArrayAccessClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'accès à une cellule de tableau. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_array_access_init(GArrayAccess *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->visit = (dec_instr_visit_fc)g_array_access_visit;
- instr->replace = (dec_instr_replace_fc)g_array_access_replace;
- instr->print = (dec_instr_print_fc)g_array_access_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : array = tableau auquel on doit accéder. *
-* index = indice de la cellule concernée. *
-* *
-* Description : Construit un accès à une cellule de tableau comme expression.*
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_array_access_new(GDecExpression *array, GDecExpression *index)
-{
- GArrayAccess *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_ARRAY_ACCESS, NULL);
-
- result->array = array;
- result->index = index;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_array_access_visit(GArrayAccess *expr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
-
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->array), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- if (result)
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->index), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_array_access_replace(GArrayAccess *expr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
-
- if (expr->array == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->array));
- g_object_ref(G_OBJECT(new));
- expr->array = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result = g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->array), old, new);
-
- if (expr->index == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->index));
- g_object_ref(G_OBJECT(new));
- expr->index = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result |= g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->index), old, new);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_array_access_print(const GArrayAccess *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->array),
- buffer, line, output);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "[", 1, RTT_RAW, NULL);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->index),
- buffer, result, output);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "]", 1, RTT_RAW, NULL);
-
- return result;
-
-}
diff --git a/src/decomp/expr/array.h b/src/decomp/expr/array.h
deleted file mode 100644
index 2cce58a..0000000
--- a/src/decomp/expr/array.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * array.h - prototypes pour les manipulations de tableaux génériques
- *
- * Copyright (C) 2010 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 _DECOMP_EXPR_ARRAY_H
-#define _DECOMP_EXPR_ARRAY_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../instruction.h"
-
-
-
-#define G_TYPE_ARRAY_ACCESS g_array_access_get_type()
-#define G_ARRAY_ACCESS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_array_access_get_type(), GArrayAccess))
-#define G_IS_ARRAY_ACCESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_array_access_get_type()))
-#define G_ARRAY_ACCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ARRAY_ACCESS, GArrayAccessClass))
-#define G_IS_ARRAY_ACCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ARRAY_ACCESS))
-#define G_ARRAY_ACCESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ARRAY_ACCESS, GArrayAccessClass))
-
-
-
-/* Définition d'un accès à une cellule de tableau (instance) */
-typedef struct _GArrayAccess GArrayAccess;
-
-/* Définition d'un accès à une cellule de tableau (classe) */
-typedef struct _GArrayAccessClass GArrayAccessClass;
-
-
-
-/* Indique le type défini pour un accès à une cellule de tableau. */
-GType g_array_access_get_type(void);
-
-/* Construit un accès à une cellule de tableau comme expression. */
-GDecInstruction *g_array_access_new(GDecExpression *, GDecExpression *);
-
-
-
-#endif /* _DECOMP_EXPR_ARRAY_H */
diff --git a/src/decomp/expr/assign.c b/src/decomp/expr/assign.c
deleted file mode 100644
index 6a614ae..0000000
--- a/src/decomp/expr/assign.c
+++ /dev/null
@@ -1,287 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * assign.c - représentation des assignations
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "assign.h"
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'une assignation quelconque (instance) */
-struct _GAssignExpression
-{
- GDecExpression parent; /* A laisser en premier */
-
- GDecExpression *dest; /* Destination de l'assignat° */
- GDecExpression *src; /* Source de l'assignation */
-
-};
-
-
-/* Définition d'une assignation quelconque (classe) */
-struct _GAssignExpressionClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des assignations quelconques. */
-static void g_assign_expression_class_init(GAssignExpressionClass *);
-
-/* Initialise une instance d'assignation quelconque. */
-static void g_assign_expression_init(GAssignExpression *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_assign_expression_visit(GAssignExpression *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_assign_expression_replace(GAssignExpression *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_assign_expression_print(const GAssignExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour une assignation quelconque. */
-G_DEFINE_TYPE(GAssignExpression, g_assign_expression, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des assignations quelconques. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_assign_expression_class_init(GAssignExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'assignation quelconque. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_assign_expression_init(GAssignExpression *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->visit = (dec_instr_visit_fc)g_assign_expression_visit;
- instr->replace = (dec_instr_replace_fc)g_assign_expression_replace;
- instr->print = (dec_instr_print_fc)g_assign_expression_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : dest = expression servant de destination. *
-* src = source de l'expression à transférer. *
-* *
-* Description : Assigne le contenu d'une expression dans une autre. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_assign_expression_new(GDecExpression *dest, GDecExpression *src)
-{
- GAssignExpression *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_ASSIGN_EXPRESSION, NULL);
-
- result->dest = dest;
- result->src = src;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_assign_expression_visit(GAssignExpression *expr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
-
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->dest), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- if (result)
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->src), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_assign_expression_replace(GAssignExpression *expr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
-
- if (expr->dest == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->dest));
- g_object_ref(G_OBJECT(new));
- expr->dest = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result = g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->dest), old, new);
-
- if (expr->src == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->src));
- g_object_ref(G_OBJECT(new));
- expr->src = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result |= g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->src), old, new);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_assign_expression_print(const GAssignExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->dest),
- buffer, line, output);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " = ", 3, RTT_SIGNS, NULL);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->src),
- buffer, result, output);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : assign = expression à consulter. *
-* *
-* Description : Indique la destination d'une assignation. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecExpression *g_assign_expression_get_dest(const GAssignExpression *assign)
-{
- return assign->dest;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : assign = expression à consulter. *
-* *
-* Description : Indique la source d'une assignation. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecExpression *g_assign_expression_get_src(const GAssignExpression *assign)
-{
- return assign->src;
-
-}
diff --git a/src/decomp/expr/assign.h b/src/decomp/expr/assign.h
deleted file mode 100644
index ed1ad91..0000000
--- a/src/decomp/expr/assign.h
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * assign.h - prototypes pour la représentation des assignations
- *
- * Copyright (C) 2010-2013 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 _DECOMP_EXPR_ASSIGN_H
-#define _DECOMP_EXPR_ASSIGN_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../instruction.h"
-
-
-
-#define G_TYPE_ASSIGN_EXPRESSION g_assign_expression_get_type()
-#define G_ASSIGN_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_assign_expression_get_type(), GAssignExpression))
-#define G_IS_ASSIGN_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_assign_expression_get_type()))
-#define G_ASSIGN_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ASSIGN_EXPRESSION, GAssignExpressionClass))
-#define G_IS_ASSIGN_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ASSIGN_EXPRESSION))
-#define G_ASSIGN_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ASSIGN_EXPRESSION, GAssignExpressionClass))
-
-
-
-/* Définition d'une assignation quelconque (instance) */
-typedef struct _GAssignExpression GAssignExpression;
-
-/* Définition d'une assignation quelconque (classe) */
-typedef struct _GAssignExpressionClass GAssignExpressionClass;
-
-
-/* Indique le type défini pour une assignation quelconque. */
-GType g_assign_expression_get_type(void);
-
-/* Assigne le contenu d'une expression dans une autre. */
-GDecInstruction *g_assign_expression_new(GDecExpression *, GDecExpression *);
-
-/* Indique la destination d'une assignation. */
-GDecExpression *g_assign_expression_get_dest(const GAssignExpression *);
-
-/* Indique la source d'une assignation. */
-GDecExpression *g_assign_expression_get_src(const GAssignExpression *);
-
-
-
-#endif /* _DECOMP_EXPR_ASSIGN_H */
diff --git a/src/decomp/expr/block.c b/src/decomp/expr/block.c
deleted file mode 100644
index e7d11a7..0000000
--- a/src/decomp/expr/block.c
+++ /dev/null
@@ -1,395 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * block.c - regroupement d'un lot d'instructions
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "block.h"
-
-
-#include <malloc.h>
-#include <string.h>
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'un ensemble d'instructions décompilées (instance) */
-struct _GExprBlock
-{
- GDecExpression parent; /* A laisser en premier */
-
- BlockBordeBehavior behavior; /* Type de Rendu des bordures */
-
- GDecInstruction **list; /* Instructions contenues */
- size_t count; /* Taille de cette liste */
-
-};
-
-
-/* Définition d'un ensemble d'instructions décompilées (classe) */
-struct _GExprBlockClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des ensembles d'instructions. */
-static void g_expr_block_class_init(GExprBlockClass *);
-
-/* Initialise une instance d'ensemble d'instructions. */
-static void g_expr_block_init(GExprBlock *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_expr_block_visit(GExprBlock *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_expr_block_replace(GExprBlock *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_expr_block_print(const GExprBlock *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un ensemble d'instructions décompilées. */
-G_DEFINE_TYPE(GExprBlock, g_expr_block, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des ensembles d'instructions. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_expr_block_class_init(GExprBlockClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = instance à initialiser. *
-* *
-* Description : Initialise une instance d'ensemble d'instructions. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_expr_block_init(GExprBlock *block)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(block);
-
- instr->visit = (dec_instr_visit_fc)g_expr_block_visit;
- instr->replace = (dec_instr_replace_fc)g_expr_block_replace;
- instr->print = (dec_instr_print_fc)g_expr_block_print;
-
- block->behavior = BBB_AUTO;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : item = premier élément du nouvel ensemble. *
-* *
-* Description : Constuit un conteneur pour diverses instructions décompilées.*
-* *
-* Retour : Conteneur d'instructions mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_expr_block_new(GDecInstruction *item)
-{
- GExprBlock *result; /* Groupe d'instructions à renvoyer */
-
- result = g_object_new(G_TYPE_EXPR_BLOCK, NULL);
-
- g_expr_block_add_item(result, item);
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = première instruction à venir visiter. *
-* *
-* Description : Fournit le comportement du bloc pour le rendu de ses bords. *
-* *
-* Retour : Comportement pour le rendu des bordures. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-BlockBordeBehavior g_expr_block_get_border_behavior(const GExprBlock *block)
-{
- return block->behavior;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = première instruction à venir visiter. *
-* behavior = comportement pour le rendu des bordures. *
-* *
-* Description : Définit le comportement du bloc pour le rendu de ses bords. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_expr_block_set_border_behavior(GExprBlock *block, BlockBordeBehavior behavior)
-{
- block->behavior = behavior;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_expr_block_visit(GExprBlock *block, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
-
- result = true;
-
- for (i = 0; i < block->count && result; i++)
- result = _g_dec_instruction_visit(block->list[i], G_DEC_INSTRUCTION(block),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_expr_block_replace(GExprBlock *block, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
-
- result = false;
-
- for (i = 0; i < block->count; i++)
- {
- if (block->list[i] == old)
- {
- g_object_unref(G_OBJECT(block->list[i]));
- g_object_ref(G_OBJECT(new));
- block->list[i] = new;
-
- result = true;
-
- }
- else
- result |= g_dec_instruction_replace(block->list[i], old, new);
-
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_expr_block_print(const GExprBlock *block, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
- size_t expr_count; /* Taille officielle */
- size_t i; /* Boucle de parcours */
-
- switch (block->behavior)
- {
- case BBB_AUTO:
- expr_count = block->count;
- break;
- case BBB_FORCE_OFF:
- expr_count = 1;
- break;
- case BBB_FORCE_ON:
- expr_count = 2;
- break;
- }
-
- result = g_lang_output_start_code_block(output, buffer, line, expr_count);
-
- for (i = 0; i < block->count; i++)
- {
- if (i > 0)
- result = g_code_buffer_append_new_line_fixme(buffer); /* FIXME : n° de ligne */
-
- result = g_dec_instruction_print(block->list[i], buffer, result, output);
-
- }
-
- result = g_lang_output_end_code_block(output, buffer, result, expr_count);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = ensemble à faire évoluer. *
-* item = nouvel élément à placer dans l'ensemble. *
-* *
-* Description : Ajoute une instruction décompilée au conteneur existant. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_expr_block_add_item(GExprBlock *block, GDecInstruction *item)
-{
- block->list = (GDecInstruction **)realloc(block->list,
- ++block->count * sizeof(GDecInstruction *));
- block->list[block->count - 1] = item;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = ensemble à consulter. *
-* index = indice de l'instruction décompilée recherchée. *
-* *
-* Description : Fournit une instruction décompilée donnée du conteneur. *
-* *
-* Retour : Instruction décompilée, ou NULL si l'indice n'est pas valide.*
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_expr_block_get_item(const GExprBlock *block, size_t index)
-{
- GDecInstruction *result; /* Elément à retourner */
-
- result = NULL;
-
- if (index < block->count)
- result = block->list[index];
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : block = ensemble à faire évoluer. *
-* item = nouvel élément à retirer de l'ensemble. *
-* *
-* Description : Supprime une instruction décompilée du conteneur existant. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_expr_block_delete_item(GExprBlock *block, GDecInstruction *item)
-{
- size_t i; /* Boucle de parcours */
-
- for (i = 0; i < block->count; i++)
- if (block->list[i] == item)
- break;
-
- if (i < block->count)
- {
- if ((i + 1) < block->count)
- memmove(&block->list[i], &block->list[i + 1],
- (block->count - i - 1) * sizeof(GDecInstruction *));
-
- block->list = (GDecInstruction **)realloc(block->list,
- --block->count * sizeof(GDecInstruction *));
-
- g_object_unref(G_OBJECT(item));
-
- }
-
-}
diff --git a/src/decomp/expr/block.h b/src/decomp/expr/block.h
deleted file mode 100644
index 88abc91..0000000
--- a/src/decomp/expr/block.h
+++ /dev/null
@@ -1,84 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * block.h - prototypes pour le regroupement d'un lot d'instructions
- *
- * Copyright (C) 2010-2013 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 _DECOMP_EXPR_BLOCK_H
-#define _DECOMP_EXPR_BLOCK_H
-
-
-#include <glib-object.h>
-
-
-#include "../instruction.h"
-
-
-
-#define G_TYPE_EXPR_BLOCK g_expr_block_get_type()
-#define G_EXPR_BLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_expr_block_get_type(), GExprBlock))
-#define G_IS_EXPR_BLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_expr_block_get_type()))
-#define G_EXPR_BLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_EXPR_BLOCK, GExprBlockClass))
-#define G_IS_EXPR_BLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_EXPR_BLOCK))
-#define G_EXPR_BLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_EXPR_BLOCK, GExprBlockClass))
-
-
-
-/* Définition d'un ensemble d'instructions décompilées (instance) */
-typedef struct _GExprBlock GExprBlock;
-
-/* Définition d'un ensemble d'instructions décompilées (classe) */
-typedef struct _GExprBlockClass GExprBlockClass;
-
-
-/* Rendu des bordures */
-typedef enum _BlockBordeBehavior
-{
- BBB_AUTO,
- BBB_FORCE_OFF,
- BBB_FORCE_ON
-
-} BlockBordeBehavior;
-
-
-/* Indique le type défini pour un ensemble d'instructions décompilées. */
-GType g_expr_block_get_type(void);
-
-/* Constuit un conteneur pour diverses instructions décompilées. */
-GDecInstruction *g_expr_block_new(GDecInstruction *);
-
-/* Fournit le comportement du bloc pour le rendu de ses bords. */
-BlockBordeBehavior g_expr_block_get_border_behavior(const GExprBlock *);
-
-/* Définit le comportement du bloc pour le rendu de ses bords. */
-void g_expr_block_set_border_behavior(GExprBlock *, BlockBordeBehavior);
-
-/* Ajoute une instruction décompilée au conteneur existant. */
-void g_expr_block_add_item(GExprBlock *, GDecInstruction *);
-
-/* Fournit une instruction décompilée donnée du conteneur. */
-GDecInstruction *g_expr_block_get_item(const GExprBlock *, size_t);
-
-/* Supprime une instruction décompilée du conteneur existant. */
-void g_expr_block_delete_item(GExprBlock *, GDecInstruction *);
-
-
-
-#endif /* _DECOMP_EXPR_BLOCK_H */
diff --git a/src/decomp/expr/call.c b/src/decomp/expr/call.c
deleted file mode 100644
index 6387730..0000000
--- a/src/decomp/expr/call.c
+++ /dev/null
@@ -1,290 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * call.c - encadrement des appels de routine
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "call.h"
-
-
-#include <malloc.h>
-#include <string.h>
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'un appel à une routine quelconque (instance) */
-struct _GRoutineCall
-{
- GDecExpression parent; /* A laisser en premier */
-
- GBinRoutine *routine; /* Routine sollicitée */
-
- GDecInstruction **args; /* Arguments à associer */
- size_t count; /* Nombre d'arguments présents */
-
-};
-
-
-/* Définition d'un appel à une routine quelconque (classe) */
-struct _GRoutineCallClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des appels à une routine quelconque. */
-static void g_routine_call_class_init(GRoutineCallClass *);
-
-/* Initialise une instance d'appel à une routine quelconque. */
-static void g_routine_call_init(GRoutineCall *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_routine_call_visit(GRoutineCall *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_routine_call_replace(GRoutineCall *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_routine_call_print(const GRoutineCall *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un appel à une routine quelconque. */
-G_DEFINE_TYPE(GRoutineCall, g_routine_call, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des appels à une routine quelconque. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_routine_call_class_init(GRoutineCallClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'appel à une routine quelconque. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_routine_call_init(GRoutineCall *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->visit = (dec_instr_visit_fc)g_routine_call_visit;
- instr->replace = (dec_instr_replace_fc)g_routine_call_replace;
- instr->print = (dec_instr_print_fc)g_routine_call_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : routine = routine dont il est fait appel. *
-* *
-* Description : Exprime un appel à une routine quelconque. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_routine_call_new(GBinRoutine *routine)
-{
- GRoutineCall *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_ROUTINE_CALL, NULL);
-
- result->routine = routine;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : call = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_routine_call_visit(GRoutineCall *call, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
-
- result = true;
-
- for (i = 0; i < call->count && result; i++)
- result = _g_dec_instruction_visit(call->args[i], G_DEC_INSTRUCTION(call),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : call = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_routine_call_replace(GRoutineCall *call, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
-
- result = false;
-
- for (i = 0; i < call->count; i++)
- {
- if (call->args[i] == old)
- {
- g_object_unref(G_OBJECT(call->args[i]));
- g_object_ref(G_OBJECT(new));
- call->args[i] = new;
-
- result = true;
-
- }
- else
- result |= g_dec_instruction_replace(call->args[i], old, new);
-
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : call = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_routine_call_print(const GRoutineCall *call, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
- const char *name; /* Désignation de la routine */
- size_t i; /* Boucle de parcours */
-
- name = g_binary_routine_get_name(call->routine);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, name, strlen(name), RTT_RAW, NULL);
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "(", 1, RTT_PUNCT, NULL);
-
- if (call->count > 0)
- {
- result = g_dec_instruction_print(call->args[0], buffer, line, output);
-
- for (i = 1; i < call->count; i++)
- {
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, ",", 1, RTT_PUNCT, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
- g_dec_instruction_print(call->args[i], buffer, result, output);
-
- }
-
- }
- else result = line;
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, ")", 1, RTT_PUNCT, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : call = expression d'appel à mettre à jour. *
-* arg = nouvel argument à associer à l'appel. *
-* *
-* Description : Enregistre un nouvel argument pour l'appel de routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_routine_call_add_arg(GRoutineCall *call, GDecInstruction *arg)
-{
- call->args = (GDecInstruction **)realloc(call->args,
- ++call->count * sizeof(GDecInstruction *));
-
- call->args[call->count - 1] = arg;
-
- /* TODO : synchroniser avec la routine (cf. constructeurs construits à la volée) */
-
-}
diff --git a/src/decomp/expr/call.h b/src/decomp/expr/call.h
deleted file mode 100644
index 7ce8354..0000000
--- a/src/decomp/expr/call.h
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * call.h - prototypes pour l'encadrement des appels de routine
- *
- * Copyright (C) 2010-2012 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 _DECOMP_EXPR_CALL_H
-#define _DECOMP_EXPR_CALL_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../instruction.h"
-#include "../../analysis/routine.h"
-
-
-
-#define G_TYPE_ROUTINE_CALL g_routine_call_get_type()
-#define G_ROUTINE_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_routine_call_get_type(), GRoutineCall))
-#define G_IS_ROUTINE_CALL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_routine_call_get_type()))
-#define G_ROUTINE_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ROUTINE_CALL, GRoutineCallClass))
-#define G_IS_ROUTINE_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ROUTINE_CALL))
-#define G_ROUTINE_CALL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ROUTINE_CALL, GRoutineCallClass))
-
-
-
-/* Définition d'un appel à une routine quelconque (instance) */
-typedef struct _GRoutineCall GRoutineCall;
-
-/* Définition d'un appel à une routine quelconque (classe) */
-typedef struct _GRoutineCallClass GRoutineCallClass;
-
-
-/* Indique le type défini pour un appel à une routine quelconque. */
-GType g_routine_call_get_type(void);
-
-/* Exprime un appel à une routine quelconque. */
-GDecInstruction *g_routine_call_new(GBinRoutine *);
-
-/* Enregistre un nouvel argument pour l'appel de routine. */
-void g_routine_call_add_arg(GRoutineCall *, GDecInstruction *);
-
-
-
-#endif /* _DECOMP_EXPR_CALL_H */
diff --git a/src/decomp/expr/comp.c b/src/decomp/expr/comp.c
deleted file mode 100644
index 6d22898..0000000
--- a/src/decomp/expr/comp.c
+++ /dev/null
@@ -1,311 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * comp.c - représentation des comparaisons
- *
- * Copyright (C) 2013 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/>.
- */
-
-
-#include "comp.h"
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'une comparaison binaire quelconque (instance) */
-struct _GCompExpression
-{
- GDecExpression parent; /* A laisser en premier */
-
- GDecExpression *a; /* Premier élément à comparer */
- CompSignType sign; /* Méthode de comparaison */
- GDecExpression *b; /* Second élément à comparer */
-
-};
-
-
-/* Définition d'une comparaison binaire quelconque (classe) */
-struct _GCompExpressionClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des comparaisons binaires quelconques. */
-static void g_comp_expression_class_init(GCompExpressionClass *);
-
-/* Initialise une instance de comparaison binaire quelconque. */
-static void g_comp_expression_init(GCompExpression *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_comp_expression_visit(GCompExpression *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_comp_expression_replace(GCompExpression *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_comp_expression_print(const GCompExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-/* Réalise une négation sur une expression décompilée. */
-static bool g_comp_expression_negate(GCompExpression *);
-
-
-
-/* Indique le type défini pour une comparaison binaire quelconque. */
-G_DEFINE_TYPE(GCompExpression, g_comp_expression, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des comparaisons binaires quelconques. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_comp_expression_class_init(GCompExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance de comparaison binaire quelconque. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_comp_expression_init(GCompExpression *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
- GDecExpression *base; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->visit = (dec_instr_visit_fc)g_comp_expression_visit;
- instr->replace = (dec_instr_replace_fc)g_comp_expression_replace;
- instr->print = (dec_instr_print_fc)g_comp_expression_print;
-
- base = G_DEC_EXPRESSION(expr);
-
- base->negate = (dec_expr_negate_fc)g_comp_expression_negate;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : a = second élément à comparer. *
-* sign = choix de la méthode de comparaison. *
-* b = second élément à comparer. *
-* *
-* Description : Exprime une comparaison binaire quelconque. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecExpression *g_comp_expression_new(GDecExpression *a, CompSignType sign, GDecExpression *b)
-{
- GCompExpression *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_COMP_EXPRESSION, NULL);
-
- result->a = a;
- result->sign = sign;
- result->b = b;
-
- return G_DEC_EXPRESSION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_comp_expression_visit(GCompExpression *expr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
-
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->a), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- if (result)
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->b), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_comp_expression_replace(GCompExpression *expr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
-
- if (expr->a == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->a));
- g_object_ref(G_OBJECT(new));
- expr->a = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result = g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->a), old, new);
-
- if (expr->b == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->b));
- g_object_ref(G_OBJECT(new));
- expr->b = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result |= g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->b), old, new);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_comp_expression_print(const GCompExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
-
- result = line;
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->a),
- buffer, result, output);
-
- g_lang_output_write_comp_sign(output, result, expr->sign);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->b),
- buffer, result, output);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à traiter. *
-* *
-* Description : Réalise une négation sur une expression décompilée. *
-* *
-* Retour : true si la négation a été gérée, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_comp_expression_negate(GCompExpression *expr)
-{
- bool result; /* Bilan à retourner */
-
- result = true;
-
- switch (expr->sign)
- {
- case CST_EQ:
- expr->sign = CST_NE;
- break;
- case CST_NE:
- expr->sign = CST_EQ;
- break;
- case CST_LT:
- expr->sign = CST_GE;
- break;
- case CST_GE:
- expr->sign = CST_LT;
- break;
- case CST_GT:
- expr->sign = CST_LE;
- break;
- case CST_LE:
- expr->sign = CST_GT;
- break;
- default:
- result = false;
- break;
-
- }
-
- return result;
-
-}
diff --git a/src/decomp/expr/comp.h b/src/decomp/expr/comp.h
deleted file mode 100644
index d3f534c..0000000
--- a/src/decomp/expr/comp.h
+++ /dev/null
@@ -1,60 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * comp.h - prototypes pour la représentation des comparaisons
- *
- * Copyright (C) 2013 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 _DECOMP_EXPR_COMP_H
-#define _DECOMP_EXPR_COMP_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../output.h"
-
-
-
-#define G_TYPE_COMP_EXPRESSION g_comp_expression_get_type()
-#define G_COMP_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_comp_expression_get_type(), GCompExpression))
-#define G_IS_COMP_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_comp_expression_get_type()))
-#define G_COMP_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_COMP_EXPRESSION, GCompExpressionClass))
-#define G_IS_COMP_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_COMP_EXPRESSION))
-#define G_COMP_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_COMP_EXPRESSION, GCompExpressionClass))
-
-
-
-/* Définition d'une comparaison binaire quelconque (instance) */
-typedef struct _GCompExpression GCompExpression;
-
-/* Définition d'une comparaison binaire quelconque (classe) */
-typedef struct _GCompExpressionClass GCompExpressionClass;
-
-
-/* Indique le type défini pour une comparaison binaire quelconque. */
-GType g_comp_expression_get_type(void);
-
-/* Exprime une comparaison binaire quelconque. */
-GDecExpression *g_comp_expression_new(GDecExpression *, CompSignType, GDecExpression *);
-
-
-
-#endif /* _DECOMP_EXPR_COMP_H */
diff --git a/src/decomp/expr/cond.c b/src/decomp/expr/cond.c
deleted file mode 100644
index c0b3f83..0000000
--- a/src/decomp/expr/cond.c
+++ /dev/null
@@ -1,461 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * cond.c - représentation des conditions
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "cond.h"
-
-
-#include <malloc.h>
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'une condition binaire quelconque (instance) */
-struct _GCondExpression
-{
- GDecExpression parent; /* A laisser en premier */
-
- CondOperatorType operator; /* Opérateur de la liste */
-
- union
- {
- GDecExpression *exp; /* Expression analysée de base */
- struct
- {
- GCondExpression **conds; /* Liste d'expressions */
- size_t count; /* Taille de cette liste */
- };
- };
-
-};
-
-
-/* Définition d'une condition binaire quelconque (classe) */
-struct _GCondExpressionClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des conditions binaires quelconques. */
-static void g_cond_expression_class_init(GCondExpressionClass *);
-
-/* Initialise une instance de condition binaire quelconque. */
-static void g_cond_expression_init(GCondExpression *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_cond_expression_visit(GCondExpression *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_cond_expression_replace(GCondExpression *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_cond_expression_print(const GCondExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-/* Réalise une négation sur une expression décompilée. */
-static bool g_cond_expression_negate(GCondExpression *);
-
-
-
-/* Indique le type défini pour une condition binaire quelconque. */
-G_DEFINE_TYPE(GCondExpression, g_cond_expression, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des conditions binaires quelconques. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_cond_expression_class_init(GCondExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : cond = instance à initialiser. *
-* *
-* Description : Initialise une instance de condition binaire quelconque. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_cond_expression_init(GCondExpression *cond)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
- GDecExpression *expr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(cond);
-
- instr->visit = (dec_instr_visit_fc)g_cond_expression_visit;
- instr->replace = (dec_instr_replace_fc)g_cond_expression_replace;
- instr->print = (dec_instr_print_fc)g_cond_expression_print;
-
- expr = G_DEC_EXPRESSION(cond);
-
- expr->negate = (dec_expr_negate_fc)g_cond_expression_negate;
-
- cond->operator = COT_NONE;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : exp = expression sur laquelle repose la condition. *
-* *
-* Description : Exprime une condition binaire quelconque. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecExpression *g_cond_expression_new(GDecExpression *exp)
-{
- GCondExpression *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_COND_EXPRESSION, NULL);
-
- result->exp = exp;
-
- return G_DEC_EXPRESSION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_cond_expression_visit(GCondExpression *expr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
-
- if (expr->operator == COT_NONE)
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->exp), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- else
- {
- result = true;
-
- for (i = 0; i < expr->count && result; i++)
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->conds[i]),
- G_DEC_INSTRUCTION(expr),
- callback, flags, data);
-
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_cond_expression_replace(GCondExpression *expr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
-
- if (expr->operator == COT_NONE)
- {
- if (expr->exp == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->exp));
- g_object_ref(G_OBJECT(new));
- expr->exp = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result = g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->exp), old, new);
-
- }
- else
- {
- result = false;
-
- for (i = 0; i < expr->count; i++)
- {
- if (expr->conds[i] == G_COND_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->conds[i]));
- g_object_ref(G_OBJECT(new));
- expr->conds[i] = G_COND_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result |= g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->conds[i]), old, new);
-
- }
-
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_cond_expression_print(const GCondExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
- size_t i; /* Boucle de parcours */
-
- result = g_lang_output_encapsulate_condition(output, buffer, line, true);
-
- if (expr->operator == COT_NONE)
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->exp),
- buffer, result, output);
-
- else
- for (i = 0; i < expr->count; i++)
- {
- if (i > 0)
- g_lang_output_write_cond_operator(output, result, expr->operator);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->conds[i]),
- buffer, result, output);
-
- }
-
- result = g_lang_output_encapsulate_condition(output, buffer, result, false);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : cond = instance à traiter. *
-* *
-* Description : Réalise une négation sur une expression décompilée. *
-* *
-* Retour : true si la négation a été gérée, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_cond_expression_negate(GCondExpression *cond)
-{
- size_t i; /* Boucle de parcours */
-
- if (cond->operator == COT_NONE)
- g_dec_expression_negate(cond->exp);
-
- else
- {
- cond->operator = (cond->operator == COT_AND ? COT_OR : COT_AND);
-
- for (i = 0; i < cond->count; i++)
- g_dec_expression_negate(G_DEC_EXPRESSION(cond->conds[i]));
-
- }
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : cond = instance à consulter. *
-* *
-* Description : Fournit l'opération logique entre les comparaisons. *
-* *
-* Retour : Opération liant les différentes parties, ou COT_NONE. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-CondOperatorType g_cond_expression_get_operator(const GCondExpression *cond)
-{
- return cond->operator;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : cond = instance à consulter. *
-* *
-* Description : Fournit l'expression d'une condition. *
-* *
-* Retour : Expression sur laquelle repose la condition. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecExpression *g_cond_expression_get_expression(const GCondExpression *cond)
-{
- return cond->exp;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : cond = instance à modifier. *
-* exp = expression sur laquelle repose la condition. *
-* *
-* Description : Définit l'expression d'une condition. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_cond_expression_set_expression(GCondExpression *cond, GDecExpression *exp)
-{
- if (cond->exp != NULL)
- g_object_unref(G_OBJECT(cond->exp));
-
- cond->exp = exp;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : cond = instance à compléter. *
-* extra = condition à rajouter. *
-* op = lien avec le reste de la condition. *
-* *
-* Description : Etend l'expression d'une condition. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_cond_expression_add_condition(GCondExpression *cond, GCondExpression *extra, CondOperatorType op)
-{
- GCondExpression *existing; /* Expr. première revalorisée */
-
- if (cond->operator == COT_NONE)
- {
- existing = G_COND_EXPRESSION(g_cond_expression_new(cond->exp));
- goto gceac_replace_existing;
- }
- else
- {
- if (cond->operator == op)
- {
- cond->conds = (GCondExpression **)calloc(++cond->count, sizeof(GCondExpression));
- cond->conds[cond->count - 1] = extra;
- }
- else
- {
- existing = G_COND_EXPRESSION(g_cond_expression_new(NULL));
-
- existing->operator = cond->operator;
- existing->conds = cond->conds;
- existing->count = cond->count;
-
- goto gceac_replace_existing;
-
- }
-
- }
-
- gceac_done:
-
- return;
-
- gceac_replace_existing:
-
- cond->operator = op;
-
- cond->conds = (GCondExpression **)calloc(2, sizeof(GCondExpression));
- cond->conds[0] = existing;
- cond->conds[1] = extra;
-
- cond->count = 2;
-
- goto gceac_done;
-
-}
diff --git a/src/decomp/expr/cond.h b/src/decomp/expr/cond.h
deleted file mode 100644
index 7980a75..0000000
--- a/src/decomp/expr/cond.h
+++ /dev/null
@@ -1,72 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * cond.h - prototypes pour la représentation des conditions
- *
- * Copyright (C) 2010-2013 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 _DECOMP_EXPR_COND_H
-#define _DECOMP_EXPR_COND_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../output.h"
-
-
-
-#define G_TYPE_COND_EXPRESSION g_cond_expression_get_type()
-#define G_COND_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_cond_expression_get_type(), GCondExpression))
-#define G_IS_COND_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_cond_expression_get_type()))
-#define G_COND_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_COND_EXPRESSION, GCondExpressionClass))
-#define G_IS_COND_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_COND_EXPRESSION))
-#define G_COND_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_COND_EXPRESSION, GCondExpressionClass))
-
-
-
-/* Définition d'une condition binaire quelconque (instance) */
-typedef struct _GCondExpression GCondExpression;
-
-/* Définition d'une condition binaire quelconque (classe) */
-typedef struct _GCondExpressionClass GCondExpressionClass;
-
-
-/* Indique le type défini pour une condition binaire quelconque. */
-GType g_cond_expression_get_type(void);
-
-/* Exprime une condition binaire quelconque. */
-GDecExpression *g_cond_expression_new(GDecExpression *);
-
-/* Fournit l'opération logique entre les comparaisons. */
-CondOperatorType g_cond_expression_get_operator(const GCondExpression *);
-
-/* Fournit l'expression d'une condition. */
-GDecExpression *g_cond_expression_get_expression(const GCondExpression *);
-
-/* Définit l'expression d'une condition. */
-void g_cond_expression_set_expression(GCondExpression *, GDecExpression *);
-
-/* Etend l'expression d'une condition. */
-void g_cond_expression_add_condition(GCondExpression *, GCondExpression *, CondOperatorType);
-
-
-
-#endif /* _DECOMP_EXPR_COND_H */
diff --git a/src/decomp/expr/dalvik/Makefile.am b/src/decomp/expr/dalvik/Makefile.am
deleted file mode 100644
index 1fe430e..0000000
--- a/src/decomp/expr/dalvik/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-
-noinst_LTLIBRARIES = libdecompexprdalvik.la
-
-libdecompexprdalvik_la_SOURCES = \
- array.h array.c
-
-libdecompexprdalvik_la_LDFLAGS =
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
diff --git a/src/decomp/expr/dalvik/array.c b/src/decomp/expr/dalvik/array.c
deleted file mode 100644
index 98647f4..0000000
--- a/src/decomp/expr/dalvik/array.c
+++ /dev/null
@@ -1,155 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * array.c - manipulations de tableaux propres à Dalvik
- *
- * Copyright (C) 2010 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/>.
- */
-
-
-#include "array.h"
-
-
-#include "../../expression-int.h"
-
-
-
-/* Définition d'une expression de mesure de tableau (instance) */
-struct _GDalvikALength
-{
- GDecExpression parent; /* A laisser en premier */
-
- GDecExpression *array; /* Elément auquel accéder */
-
-};
-
-
-/* Définition d'une expression de mesure de tableau (classe) */
-struct _GDalvikALengthClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des expressions de mesure de tableau. */
-static void g_dalvik_alength_class_init(GDalvikALengthClass *);
-
-/* Initialise une instance d'expression de mesure de tableau. */
-static void g_dalvik_alength_init(GDalvikALength *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static void g_dalvik_alength_print(const GDalvikALength *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour une expression de mesure de tableau. */
-G_DEFINE_TYPE(GDalvikALength, g_dalvik_alength, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des expressions de mesure de tableau. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dalvik_alength_class_init(GDalvikALengthClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'expression de mesure de tableau. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dalvik_alength_init(GDalvikALength *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->print = (dec_instr_print_fc)g_dalvik_alength_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : array = tableau dont on doit mesurer la taille. *
-* *
-* Description : Construit une expression à partir d'une mesure de tableau. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_dalvik_alength_new(GDecExpression *array)
-{
- GDalvikALength *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_DALVIK_ALENGTH, NULL);
-
- result->array = array;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dalvik_alength_print(const GDalvikALength *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- g_dec_instruction_print(G_DEC_INSTRUCTION(expr->array),
- buffer, line, output);
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY, ".", 1, RTT_RAW, NULL);
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY, "length", 6, RTT_RAW, NULL);
-
-}
diff --git a/src/decomp/expr/dalvik/array.h b/src/decomp/expr/dalvik/array.h
deleted file mode 100644
index ee50a43..0000000
--- a/src/decomp/expr/dalvik/array.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * array.h - prototypes pour les manipulations de tableaux propres à Dalvik
- *
- * Copyright (C) 2010 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 _DECOMP_EXPR_DALVIK_ARRAY_H
-#define _DECOMP_EXPR_DALVIK_ARRAY_H
-
-
-#include <glib-object.h>
-
-
-#include "../../expression.h"
-#include "../../instruction.h"
-
-
-
-#define G_TYPE_DALVIK_ALENGTH g_dalvik_alength_get_type()
-#define G_DALVIK_ALENGTH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_dalvik_alength_get_type(), GDalvikALength))
-#define G_IS_DALVIK_ALENGTH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_dalvik_alength_get_type()))
-#define G_DALVIK_ALENGTH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DALVIK_ALENGTH, GDalvikALengthClass))
-#define G_IS_DALVIK_ALENGTH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DALVIK_ALENGTH))
-#define G_DALVIK_ALENGTH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DALVIK_ALENGTH, GDalvikALengthClass))
-
-
-
-/* Définition d'une expression de mesure de tableau (instance) */
-typedef struct _GDalvikALength GDalvikALength;
-
-/* Définition d'une expression de mesure de tableau (classe) */
-typedef struct _GDalvikALengthClass GDalvikALengthClass;
-
-
-
-/* Indique le type défini pour une expression de mesure de tableau. */
-GType g_dalvik_alength_get_type(void);
-
-/* Construit une expression à partir d'une mesure de tableau. */
-GDecInstruction *g_dalvik_alength_new(GDecExpression *);
-
-
-
-#endif /* _DECOMP_EXPR_DALVIK_ARRAY_H */
diff --git a/src/decomp/expr/immediate.c b/src/decomp/expr/immediate.c
deleted file mode 100644
index 3bf2dea..0000000
--- a/src/decomp/expr/immediate.c
+++ /dev/null
@@ -1,153 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * immediate.c - raccord avec les opérandes de valeur immédiate
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "immediate.h"
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'une expression de valeur immédiate (instance) */
-struct _GImmExpression
-{
- GDecExpression parent; /* A laisser en premier */
-
- GImmOperand *operand; /* Conteneur d'origine */
-
-};
-
-
-/* Définition d'une expression de valeur immédiate (classe) */
-struct _GImmExpressionClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des expressions de valeur immédiate. */
-static void g_imm_expression_class_init(GImmExpressionClass *);
-
-/* Initialise une instance d'expression de valeur immédiate. */
-static void g_imm_expression_init(GImmExpression *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_imm_expression_print(const GImmExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour une expression de valeur immédiate. */
-G_DEFINE_TYPE(GImmExpression, g_imm_expression, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des expressions de valeur immédiate. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_imm_expression_class_init(GImmExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'expression de valeur immédiate. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_imm_expression_init(GImmExpression *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->print = (dec_instr_print_fc)g_imm_expression_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = conteneur d'origie de la valeur immédiate. *
-* *
-* Description : Construit une expression à partir d'une valeur immédiate. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_imm_expression_new(GImmOperand *operand)
-{
- GImmExpression *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_IMM_EXPRESSION, NULL);
-
- result->operand = operand;
- g_object_ref(G_OBJECT(operand)); /* FIXME : ref pas déjà acquise ? */
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_imm_expression_print(const GImmExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- g_arch_operand_print(G_ARCH_OPERAND(expr->operand), line, ASX_COUNT);
-
- return line;
-
-}
diff --git a/src/decomp/expr/immediate.h b/src/decomp/expr/immediate.h
deleted file mode 100644
index 8185754..0000000
--- a/src/decomp/expr/immediate.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * immediate.h - prototypes pour le raccord avec les opérandes de valeur immédiate
- *
- * Copyright (C) 2010 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 _DECOMP_EXPR_IMMEDIATE_H
-#define _DECOMP_EXPR_IMMEDIATE_H
-
-
-#include <glib-object.h>
-
-
-#include "../instruction.h"
-#include "../../arch/immediate.h"
-
-
-
-#define G_TYPE_IMM_EXPRESSION g_imm_expression_get_type()
-#define G_IMM_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_imm_expression_get_type(), GImmExpression))
-#define G_IS_IMM_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_imm_expression_get_type()))
-#define G_IMM_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_IMM_EXPRESSION, GImmExpressionClass))
-#define G_IS_IMM_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_IMM_EXPRESSION))
-#define G_IMM_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_IMM_EXPRESSION, GImmExpressionClass))
-
-
-
-/* Définition d'une expression de valeur immédiate (instance) */
-typedef struct _GImmExpression GImmExpression;
-
-/* Définition d'une expression de valeur immédiate (classe) */
-typedef struct _GImmExpressionClass GImmExpressionClass;
-
-
-
-/* Indique le type défini pour une expression de valeur immédiate. */
-GType g_imm_expression_get_type(void);
-
-/*Construit une expression à partir d'une valeur immédiate. */
-GDecInstruction *g_imm_expression_new(GImmOperand *);
-
-
-
-#endif /* _DECOMP_EXPR_IMMEDIATE_H */
diff --git a/src/decomp/expr/pseudo.c b/src/decomp/expr/pseudo.c
deleted file mode 100644
index 626cd8f..0000000
--- a/src/decomp/expr/pseudo.c
+++ /dev/null
@@ -1,253 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * pseudo.c - définition des pseudo-registres
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "pseudo.h"
-
-
-#include <malloc.h>
-#include <stdio.h>
-#include <string.h>
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'un pseudo-registre (instance) */
-struct _GPseudoRegister
-{
- GDecExpression parent; /* A laisser en premier */
-
- PseudoRegUsage usage; /* Type d'utilisation attendue */
-
- char *name; /* Désignation générale */
- size_t index; /* Position dans l'ensemble */
- GBinVariable *var; /* Variable plus précise */
-
-};
-
-
-/* Définition d'un pseudo-registre (classe) */
-struct _GPseudoRegisterClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des pseudo-registres. */
-static void g_pseudo_register_class_init(GPseudoRegisterClass *);
-
-/* Initialise une instance de pseudo-registre. */
-static void g_pseudo_register_init(GPseudoRegister *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_pseudo_register_print(const GPseudoRegister *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un pseudo-registre. */
-G_DEFINE_TYPE(GPseudoRegister, g_pseudo_register, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des pseudo-registres. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_pseudo_register_class_init(GPseudoRegisterClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = instance à initialiser. *
-* *
-* Description : Initialise une instance de pseudo-registre. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_pseudo_register_init(GPseudoRegister *reg)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(reg);
-
- instr->print = (dec_instr_print_fc)g_pseudo_register_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : usage = précision quant à l'usage du pseudo-registre à créer.*
-* *
-* Description : Assigne le contenu d'une expression dans une autre. *
-* *
-* Retour : Pseudo-registre mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_pseudo_register_new(PseudoRegUsage usage)
-{
- GPseudoRegister *result; /* Pseudo-registre à renvoyer */
-
- result = g_object_new(G_TYPE_PSEUDO_REGISTER, NULL);
-
- result->usage = usage;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = pseudo-registre à venir consulter. *
-* *
-* Description : Indique l'usage attendu du pseudo-registre consulté. *
-* *
-* Retour : Utilité du pseudo-registre en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-PseudoRegUsage g_pseudo_register_get_usage(const GPseudoRegister *reg)
-{
- return reg->usage;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_pseudo_register_print(const GPseudoRegister *reg, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- char label[32];
- char *name;
-
- if (reg->var != NULL)
- {
- name = g_binary_variable_to_string(reg->var, true);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, name, strlen(name), RTT_RAW, NULL);
- free(name);
- }
- else
- {
- snprintf(label, 32, "%s%zu", reg->name, reg->index);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, label, strlen(label), RTT_RAW, NULL);
- }
-
- return line;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = expression représentant un pseudo-registre à traiter. *
-* name = désignation générale à associer au pseudo-registre. *
-* *
-* Description : Définit un nom général pour un pseudo-registre donné. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_pseudo_register_set_basename(GPseudoRegister *reg, const char *name)
-{
- reg->name = strdup(name);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = expression représentant un pseudo-registre à traiter.*
-* index = indice à associer au pseudo-registre. *
-* *
-* Description : Définit un indice unique pour un pseudo-registre donné. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_pseudo_register_set_index(GPseudoRegister *reg, size_t index)
-{
- reg->index = index;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = expression représentant un pseudo-registre à traiter. *
-* var = indications supplémentaire quant à la variable. *
-* *
-* Description : Précise le nom et le type de la variable. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_pseudo_register_set_variable(GPseudoRegister *reg, GBinVariable *var)
-{
- reg->var = var;
-
-}
diff --git a/src/decomp/expr/pseudo.h b/src/decomp/expr/pseudo.h
deleted file mode 100644
index 5436404..0000000
--- a/src/decomp/expr/pseudo.h
+++ /dev/null
@@ -1,83 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * pseudo.h - prototypes pour la définition des pseudo-registres
- *
- * Copyright (C) 2010-2013 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 _DECOMP_EXPR_PSEUDO_H
-#define _DECOMP_EXPR_PSEUDO_H
-
-
-#include <glib-object.h>
-
-
-#include "../instruction.h"
-#include "../../analysis/variable.h"
-
-
-
-#define G_TYPE_PSEUDO_REGISTER g_pseudo_register_get_type()
-#define G_PSEUDO_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_pseudo_register_get_type(), GPseudoRegister))
-#define G_IS_PSEUDO_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_pseudo_register_get_type()))
-#define G_PSEUDO_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_PSEUDO_REGISTER, GPseudoRegisterClass))
-#define G_IS_PSEUDO_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_PSEUDO_REGISTER))
-#define G_PSEUDO_REGISTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_PSEUDO_REGISTER, GPseudoRegisterClass))
-
-
-
-/* Types de pseudo-registre */
-typedef enum _PseudoRegUsage
-{
- PRU_THIS, /* "this" pour les objets */
- PRU_ARG, /* Argument de fonction */
- PRU_LOCAL, /* Variable locale */
- PRU_FIXED /* Variable type champ */
-
-} PseudoRegUsage;
-
-
-/* Définition d'un pseudo-registre (instance) */
-typedef struct _GPseudoRegister GPseudoRegister;
-
-/* Définition d'un pseudo-registre (classe) */
-typedef struct _GPseudoRegisterClass GPseudoRegisterClass;
-
-
-/* Indique le type défini pour un pseudo-registre. */
-GType g_pseudo_register_get_type(void);
-
-/* Assigne le contenu d'une expression dans une autre. */
-GDecInstruction *g_pseudo_register_new(PseudoRegUsage);
-
-/* Indique l'usage attendu du pseudo-registre consulté. */
-PseudoRegUsage g_pseudo_register_get_usage(const GPseudoRegister *);
-
-/* Définit un nom général pour un pseudo-registre donné. */
-void g_pseudo_register_set_basename(GPseudoRegister *, const char *);
-
-/* Définit un indice unique pour un pseudo-registre donné. */
-void g_pseudo_register_set_index(GPseudoRegister *, size_t);
-
-/* Précise le nom et le type de la variable. */
-void g_pseudo_register_set_variable(GPseudoRegister *, GBinVariable *);
-
-
-
-#endif /* _DECOMP_EXPR_PSEUDO_H */
diff --git a/src/decomp/expr/return.c b/src/decomp/expr/return.c
deleted file mode 100644
index 16a5a54..0000000
--- a/src/decomp/expr/return.c
+++ /dev/null
@@ -1,243 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * return.c - représentation des ordres de retour
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "return.h"
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'un ordre de retour (instance) */
-struct _GReturnExpression
-{
- GDecExpression parent; /* A laisser en premier */
-
- GDecExpression *payload; /* Eventuel paquet associé */
-
-};
-
-
-/* Définition d'un ordre de retour (classe) */
-struct _GReturnExpressionClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des ordres de retour. */
-static void g_return_expression_class_init(GReturnExpressionClass *);
-
-/* Initialise une instance d'ordre de retour. */
-static void g_return_expression_init(GReturnExpression *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_return_expression_visit(GReturnExpression *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_return_expression_replace(GReturnExpression *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_return_expression_print(const GReturnExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un ordre de retour. */
-G_DEFINE_TYPE(GReturnExpression, g_return_expression, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des ordres de retour. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_return_expression_class_init(GReturnExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'ordre de retour. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_return_expression_init(GReturnExpression *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->visit = (dec_instr_visit_fc)g_return_expression_visit;
- instr->replace = (dec_instr_replace_fc)g_return_expression_replace;
- instr->print = (dec_instr_print_fc)g_return_expression_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : payload = éventuelle expression à associer au retour. *
-* *
-* Description : Constitue un ordre de retour vers l'appelant. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_return_expression_new(GDecExpression *payload)
-{
- GReturnExpression *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_RETURN_EXPRESSION, NULL);
-
- result->payload = payload;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_return_expression_visit(GReturnExpression *expr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
-
- if (expr->payload)
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(expr->payload), G_DEC_INSTRUCTION(expr),
- callback, flags, data);
- else
- result = false;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_return_expression_replace(GReturnExpression *expr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
-
- if (expr->payload)
- {
- if (expr->payload == G_DEC_EXPRESSION(old))
- {
- g_object_unref(G_OBJECT(expr->payload));
- g_object_ref(G_OBJECT(new));
- expr->payload = G_DEC_EXPRESSION(new);
-
- result = true;
-
- }
- else
- result = g_dec_instruction_replace(G_DEC_INSTRUCTION(expr->payload), old, new);
-
- }
- else
- result = false;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_return_expression_print(const GReturnExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "return", 6, RTT_KEY_WORD, NULL);
-
- if (expr->payload != NULL)
- {
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(expr->payload),
- buffer, line, output);
-
- }
- else result = line;
-
- return result;
-
-}
diff --git a/src/decomp/expr/return.h b/src/decomp/expr/return.h
deleted file mode 100644
index ed28b96..0000000
--- a/src/decomp/expr/return.h
+++ /dev/null
@@ -1,60 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * return.h - prototypes pour la représentation des ordres de retour
- *
- * Copyright (C) 2010 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 _DECOMP_EXPR_RETURN_H
-#define _DECOMP_EXPR_RETURN_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../instruction.h"
-
-
-
-#define G_TYPE_RETURN_EXPRESSION g_return_expression_get_type()
-#define G_RETURN_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_return_expression_get_type(), GReturnExpression))
-#define G_IS_RETURN_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_return_expression_get_type()))
-#define G_RETURN_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_RETURN_EXPRESSION, GReturnExpressionClass))
-#define G_IS_RETURN_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_RETURN_EXPRESSION))
-#define G_RETURN_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_RETURN_EXPRESSION, GReturnExpressionClass))
-
-
-
-/* Définition d'un ordre de retour (instance) */
-typedef struct _GReturnExpression GReturnExpression;
-
-/* Définition d'un ordre de retour (classe) */
-typedef struct _GReturnExpressionClass GReturnExpressionClass;
-
-
-/* Indique le type défini pour un ordre de retour. */
-GType g_return_expression_get_type(void);
-
-/* Constitue un ordre de retour vers l'appelant. */
-GDecInstruction *g_return_expression_new(GDecExpression *);
-
-
-
-#endif /* _DECOMP_EXPR_RETURN_H */
diff --git a/src/decomp/expr/text.c b/src/decomp/expr/text.c
deleted file mode 100644
index bdf0495..0000000
--- a/src/decomp/expr/text.c
+++ /dev/null
@@ -1,159 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * text.c - raccord avec les opérandes de chaînes de caractères
- *
- * Copyright (C) 2012 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/>.
- */
-
-
-#include "text.h"
-
-
-#include <string.h>
-
-
-#include "../expression-int.h"
-
-
-
-/* Définition d'une expression de valeur immédiate (instance) */
-struct _GStrExpression
-{
- GDecExpression parent; /* A laisser en premier */
-
- char *value; /* Chaîne représentée */
- size_t len; /* Taille du texte */
-
-};
-
-
-/* Définition d'une expression de valeur immédiate (classe) */
-struct _GStrExpressionClass
-{
- GDecExpressionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des expressions de valeur immédiate. */
-static void g_str_expression_class_init(GStrExpressionClass *);
-
-/* Initialise une instance d'expression de valeur immédiate. */
-static void g_str_expression_init(GStrExpression *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-static GBufferLine *g_str_expression_print(const GStrExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour une expression de valeur immédiate. */
-G_DEFINE_TYPE(GStrExpression, g_str_expression, G_TYPE_DEC_EXPRESSION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des expressions de valeur immédiate. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_str_expression_class_init(GStrExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'expression de valeur immédiate. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_str_expression_init(GStrExpression *expr)
-{
- GDecInstruction *instr; /* Autre version de l'objet */
-
- instr = G_DEC_INSTRUCTION(expr);
-
- instr->print = (dec_instr_print_fc)g_str_expression_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : value = chaîne de caractères à représenter. *
-* *
-* Description : Construit une expression à partir d'une valeur immédiate. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_str_expression_new(const char *value)
-{
- GStrExpression *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_STR_EXPRESSION, NULL);
-
- result->value = strdup(value);
- result->len = strlen(value);
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une expression. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_str_expression_print(const GStrExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "\"", 1, RTT_STRING, NULL);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, expr->value, expr->len, RTT_STRING, NULL);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "\"", 1, RTT_STRING, NULL);
-
- return line;
-
-}
diff --git a/src/decomp/expr/text.h b/src/decomp/expr/text.h
deleted file mode 100644
index e54b4db..0000000
--- a/src/decomp/expr/text.h
+++ /dev/null
@@ -1,60 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * text.h - prototypes pour le raccord avec les opérandes de chaînes de caractères
- *
- * Copyright (C) 2012 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 _DECOMP_EXPR_TEXT_H
-#define _DECOMP_EXPR_TEXT_H
-
-
-#include <glib-object.h>
-
-
-#include "../instruction.h"
-
-
-
-#define G_TYPE_STR_EXPRESSION g_str_expression_get_type()
-#define G_STR_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_str_expression_get_type(), GStrExpression))
-#define G_IS_STR_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_str_expression_get_type()))
-#define G_STR_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_STR_EXPRESSION, GStrExpressionClass))
-#define G_IS_STR_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_STR_EXPRESSION))
-#define G_STR_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_STR_EXPRESSION, GStrExpressionClass))
-
-
-
-/* Définition d'une expression de valeur immédiate (instance) */
-typedef struct _GStrExpression GStrExpression;
-
-/* Définition d'une expression de valeur immédiate (classe) */
-typedef struct _GStrExpressionClass GStrExpressionClass;
-
-
-
-/* Indique le type défini pour une expression de valeur immédiate. */
-GType g_str_expression_get_type(void);
-
-/*Construit une expression à partir d'une valeur immédiate. */
-GDecInstruction *g_str_expression_new(const char *);
-
-
-
-#endif /* _DECOMP_EXPR_TEXT_H */
diff --git a/src/decomp/expression-int.h b/src/decomp/expression-int.h
deleted file mode 100644
index 25458ce..0000000
--- a/src/decomp/expression-int.h
+++ /dev/null
@@ -1,57 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * expression-int.h - prototypes pour la définition interne des expressions décompilées
- *
- * Copyright (C) 2010-2013 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 _DECOMP_EXPRESSION_INT_H
-#define _DECOMP_EXPRESSION_INT_H
-
-
-#include "expression.h"
-#include "instruction-int.h"
-
-
-
-/* Réalise une négation sur une expression décompilée. */
-typedef bool (* dec_expr_negate_fc) (GDecExpression *);
-
-
-/* Définition d'une expression décompilée (instance) */
-struct _GDecExpression
-{
- GDecInstruction parent; /* A laisser en premier */
-
- dec_expr_negate_fc negate; /* Négation de l'expression */
- dec_instr_print_fc original_print; /* Eventuelle version négative */
-
-};
-
-
-/* Définition d'une expression décompilée (classe) */
-struct _GDecExpressionClass
-{
- GDecInstructionClass parent; /* A laisser en premier */
-
-};
-
-
-
-#endif /* _DECOMP_EXPRESSION_INT_H */
diff --git a/src/decomp/expression.c b/src/decomp/expression.c
deleted file mode 100644
index 3be1d2b..0000000
--- a/src/decomp/expression.c
+++ /dev/null
@@ -1,137 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * expression.c - gestion des expressions décompilées
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "expression.h"
-
-
-#include "expression-int.h"
-
-
-
-/* Initialise la classe des expressions décompilées. */
-static void g_dec_expression_class_init(GDecExpressionClass *);
-
-/* Initialise une instance d'expression décompilée. */
-static void g_dec_expression_init(GDecExpression *);
-
-/* Imprime pour l'écran la négation d'une expression décompilée. */
-static GBufferLine *g_dec_expression_neg_print(const GDecExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour une expression décompilée. */
-G_DEFINE_TYPE(GDecExpression, g_dec_expression, G_TYPE_DEC_INSTRUCTION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des expressions décompilées. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dec_expression_class_init(GDecExpressionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'expression décompilée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dec_expression_init(GDecExpression *expr)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = expression à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran la négation d'une expression décompilée.*
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_dec_expression_neg_print(const GDecExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "!", 1, RTT_KEY_WORD, NULL);
-
- result = expr->original_print(G_DEC_INSTRUCTION(expr), buffer, line, output);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : expr = instance à traiter. *
-* *
-* Description : Réalise une négation sur une expression décompilée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_expression_negate(GDecExpression *expr)
-{
- bool status; /* Réussite de l'opération ? */
-
- if (expr->negate != NULL)
- status = expr->negate(expr);
- else
- status = false;
-
- if (!status)
- {
- expr->original_print = G_DEC_INSTRUCTION(expr)->print;
- G_DEC_INSTRUCTION(expr)->print = (dec_instr_print_fc)g_dec_expression_neg_print;
- }
-
-}
diff --git a/src/decomp/expression.h b/src/decomp/expression.h
deleted file mode 100644
index dd8ef51..0000000
--- a/src/decomp/expression.h
+++ /dev/null
@@ -1,56 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * expression.h - prototypes pour la gestion des expressions décompilées
- *
- * Copyright (C) 2010-2013 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 _DECOMP_EXPRESSION_H
-#define _DECOMP_EXPRESSION_H
-
-
-#include <glib-object.h>
-
-
-
-#define G_TYPE_DEC_EXPRESSION g_dec_expression_get_type()
-#define G_DEC_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_dec_expression_get_type(), GDecExpression))
-#define G_IS_DEC_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_dec_expression_get_type()))
-#define G_DEC_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DEC_EXPRESSION, GDecExpressionClass))
-#define G_IS_DEC_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DEC_EXPRESSION))
-#define G_DEC_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DEC_EXPRESSION, GDecExpressionClass))
-
-
-
-/* Définition d'une expression décompilée (instance) */
-typedef struct _GDecExpression GDecExpression;
-
-/* Définition d'une expression décompilée (classe) */
-typedef struct _GDecExpressionClass GDecExpressionClass;
-
-
-/* Indique le type défini pour une expression décompilée. */
-GType g_dec_expression_get_type(void);
-
-/* Réalise une négation sur une expression décompilée. */
-void g_dec_expression_negate(GDecExpression *);
-
-
-
-#endif /* _DECOMP_EXPRESSION_H */
diff --git a/src/decomp/instr/Makefile.am b/src/decomp/instr/Makefile.am
deleted file mode 100644
index 28f6e3f..0000000
--- a/src/decomp/instr/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-
-noinst_LTLIBRARIES = libdecompinstr.la
-
-libdecompinstr_la_SOURCES = \
- ite.h ite.c \
- keyword.h keyword.c \
- switch.h switch.c
-
-libdecompinstr_la_LDFLAGS =
-
-libdecompinstr_la_LIBADD =
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-
-SUBDIRS =
diff --git a/src/decomp/instr/ite.c b/src/decomp/instr/ite.c
deleted file mode 100644
index 6e98a77..0000000
--- a/src/decomp/instr/ite.c
+++ /dev/null
@@ -1,339 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * ite.c - représentation des branchements conditionnels
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "ite.h"
-
-
-#include "../instruction-int.h"
-
-
-
-/* Définition d'un aiguillage du flux d'exécution (instance) */
-struct _GITEInstruction
-{
- GDecInstruction parent; /* A laisser en premier */
-
- GCondExpression *cond; /* Condition prise en compte */
-
- GDecInstruction *true_branch; /* Condition vérifiée */
- GDecInstruction *false_branch; /* Condition non vérifiée */
-
- union
- {
- vmpa_t addr; /* Adresse de saut */
- GDecExpression *expr; /* Expressions équivalentes */
-
- } if_true;
-
- union
- {
- vmpa_t addr; /* Adresse de saut */
- GDecExpression *expr; /* Expressions équivalentes */
-
- } if_false;
-
-};
-
-
-/* Définition d'un aiguillage du flux d'exécution (classe) */
-struct _GITEInstructionClass
-{
- GDecInstructionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des aiguillages de flux d'exécution. */
-static void g_ite_instruction_class_init(GITEInstructionClass *);
-
-/* Initialise une instance d'aiguillage du flux d'exécution. */
-static void g_ite_instruction_init(GITEInstruction *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_ite_instruction_visit(GITEInstruction *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_ite_instruction_replace(GITEInstruction *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une instruction. */
-static GBufferLine *g_ite_instruction_print(const GITEInstruction *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un aiguillage du flux d'exécution. */
-G_DEFINE_TYPE(GITEInstruction, g_ite_instruction, G_TYPE_DEC_INSTRUCTION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des aiguillages de flux d'exécution. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_ite_instruction_class_init(GITEInstructionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'aiguillage du flux d'exécution. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_ite_instruction_init(GITEInstruction *instr)
-{
- GDecInstruction *base; /* Autre version de l'objet */
-
- base = G_DEC_INSTRUCTION(instr);
-
- base->visit = (dec_instr_visit_fc)g_ite_instruction_visit;
- base->replace = (dec_instr_replace_fc)g_ite_instruction_replace;
- base->print = (dec_instr_print_fc)g_ite_instruction_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : cond = expression fixant le choix de l'aiguillage. *
-* if_true = adresse du saut si la condition est vérifiée. *
-* if_true = adresse du saut si la condition n'est pas vérifiée.*
-* *
-* Description : Exprime un aiguillage du flux en fonction d'une condition. *
-* *
-* Retour : Expression mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_ite_instruction_new(GCondExpression *cond, vmpa_t if_true, vmpa_t if_false)
-{
- GITEInstruction *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_ITE_INSTRUCTION, NULL);
-
- result->cond = cond;
- result->if_true.addr = if_true;
- result->if_false.addr = if_false;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_ite_instruction_visit(GITEInstruction *instr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
-
- result = _g_dec_instruction_visit(G_DEC_INSTRUCTION(instr->cond), G_DEC_INSTRUCTION(instr),
- callback, flags, data);
-
- if (result)
- result = _g_dec_instruction_visit(instr->true_branch, G_DEC_INSTRUCTION(instr),
- callback, flags, data);
-
- if (result && instr->false_branch != NULL)
- result = _g_dec_instruction_visit(instr->false_branch, G_DEC_INSTRUCTION(instr),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_ite_instruction_replace(GITEInstruction *instr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
-
- result = g_dec_instruction_replace(G_DEC_INSTRUCTION(instr->cond), old, new);
-
- result |= g_dec_instruction_replace(instr->true_branch, old, new);
-
- if (instr->false_branch != NULL)
- result |= g_dec_instruction_replace(instr->false_branch, old, new);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une instruction. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_ite_instruction_print(const GITEInstruction *instr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "if ", 3, RTT_KEY_WORD, NULL);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(instr->cond),
- buffer, line, output);
-
- result = g_dec_instruction_print(instr->true_branch, buffer, result, output);
-
- if (instr->false_branch != NULL)
- {
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "else", 4, RTT_KEY_WORD, NULL);
- result = g_dec_instruction_print(instr->false_branch, buffer, result, output);
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction fixant le choix de l'aiguillage. *
-* *
-* Description : Fournit la condition régissant la suite de l'exécution. *
-* *
-* Retour : Condition mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GCondExpression *g_ite_instruction_get_condition(const GITEInstruction *instr)
-{
- return instr->cond;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = expression fixant le choix de l'aiguillage. *
-* true_branch = instructions si la condition est vérifiée. *
-* false_branch = instructions si la cond. n'est pas vérifiée. *
-* *
-* Description : Détermine le corps des différentes branches possibles. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_ite_instruction_set_branches(GITEInstruction *instr, GDecInstruction *true_branch, GDecInstruction *false_branch)
-{
- if (instr->true_branch != NULL) g_object_unref(G_OBJECT(instr->true_branch));
- if (instr->false_branch != NULL) g_object_unref(G_OBJECT(instr->false_branch));
-
- if (true_branch == NULL)
- {
- g_dec_expression_negate(G_DEC_EXPRESSION(instr->cond));
-
- instr->true_branch = false_branch;
- instr->false_branch = true_branch;
-
- }
- else
- {
- instr->true_branch = true_branch;
- instr->false_branch = false_branch;
- }
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction fixant le choix de l'aiguillage. *
-* true_branch = instrs. si la condition est vérifiée. [OUT] *
-* false_branch = instrs. si la cond. n'est pas vérifiée. [OUT] *
-* *
-* Description : Fournit le corps des différentes branches possibles. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_ite_instruction_get_branches(const GITEInstruction *instr, GDecInstruction **true_branch, GDecInstruction **false_branch)
-{
- if (true_branch != NULL)
- *true_branch = instr->true_branch;
-
- if (false_branch != NULL)
- *false_branch = instr->false_branch;
-
-}
diff --git a/src/decomp/instr/ite.h b/src/decomp/instr/ite.h
deleted file mode 100644
index f92663c..0000000
--- a/src/decomp/instr/ite.h
+++ /dev/null
@@ -1,70 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * ite.h - prototypes pour la représentation des branchements conditionnels
- *
- * Copyright (C) 2010-2013 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 _DECOMP_INSTR_ITE_H
-#define _DECOMP_INSTR_ITE_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../instruction.h"
-#include "../expr/cond.h"
-
-
-
-#define G_TYPE_ITE_INSTRUCTION g_ite_instruction_get_type()
-#define G_ITE_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_ite_instruction_get_type(), GITEInstruction))
-#define G_IS_ITE_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_ite_instruction_get_type()))
-#define G_ITE_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ITE_INSTRUCTION, GITEInstructionClass))
-#define G_IS_ITE_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ITE_INSTRUCTION))
-#define G_ITE_INSTRUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ITE_INSTRUCTION, GITEInstructionClass))
-
-
-
-/* Définition d'un aiguillage du flux d'exécution (instance) */
-typedef struct _GITEInstruction GITEInstruction;
-
-/* Définition d'un aiguillage du flux d'exécution (classe) */
-typedef struct _GITEInstructionClass GITEInstructionClass;
-
-
-/* Indique le type défini pour un aiguillage du flux d'exécution. */
-GType g_ite_instruction_get_type(void);
-
-/* Exprime un aiguillage du flux en fonction d'une condition. */
-GDecInstruction *g_ite_instruction_new(GCondExpression *, vmpa_t, vmpa_t);
-
-/* Fournit la condition régissant la suite de l'exécution. */
-GCondExpression *g_ite_instruction_get_condition(const GITEInstruction *);
-
-/* Détermine le corps des différentes branches possibles. */
-void g_ite_instruction_set_branches(GITEInstruction *, GDecInstruction *, GDecInstruction *);
-
-/* Fournit le corps des différentes branches possibles. */
-void g_ite_instruction_get_branches(const GITEInstruction *, GDecInstruction **, GDecInstruction **);
-
-
-
-#endif /* _DECOMP_INSTR_ITE_H */
diff --git a/src/decomp/instr/keyword.c b/src/decomp/instr/keyword.c
deleted file mode 100644
index ea4577d..0000000
--- a/src/decomp/instr/keyword.c
+++ /dev/null
@@ -1,162 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * keyword.c - insertions de mots clefs de haut niveau
- *
- * Copyright (C) 2013 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/>.
- */
-
-
-#include "keyword.h"
-
-
-#include "../instruction-int.h"
-
-
-
-/* Définition d'un mot clef de haut niveau (instance) */
-struct _GKeywordInstruction
-{
- GDecInstruction parent; /* A laisser en premier */
-
- DecompiledKeyWord keyword; /* Mot clef représenté */
-
-};
-
-
-/* Indique le type défini pour un mot clef de haut niveau. */
-struct _GKeywordInstructionClass
-{
- GDecInstructionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des mots clefs de haut niveau. */
-static void g_keyword_instruction_class_init(GKeywordInstructionClass *);
-
-/* Initialise une instance de mot clef de haut niveau. */
-static void g_keyword_instruction_init(GKeywordInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une instruction. */
-static GBufferLine *g_keyword_instruction_print(const GKeywordInstruction *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un mot clef de haut niveau. */
-G_DEFINE_TYPE(GKeywordInstruction, g_keyword_instruction, G_TYPE_DEC_INSTRUCTION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des mots clefs de haut niveau. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_keyword_instruction_class_init(GKeywordInstructionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instance à initialiser. *
-* *
-* Description : Initialise une instance de mot clef de haut niveau. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_keyword_instruction_init(GKeywordInstruction *instr)
-{
- GDecInstruction *base; /* Autre version de l'objet */
-
- base = G_DEC_INSTRUCTION(instr);
-
- base->print = (dec_instr_print_fc)g_keyword_instruction_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : keyword = mot clef à représenter. *
-* *
-* Description : Crée un mot clef de haut niveau. *
-* *
-* Retour : Instruction mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_keyword_instruction_new(DecompiledKeyWord keyword)
-{
- GKeywordInstruction *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_KEYWORD_INSTRUCTION, NULL);
-
- result->keyword = keyword;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une instruction. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_keyword_instruction_print(const GKeywordInstruction *instr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- switch (instr->keyword)
- {
- case DKW_BREAK:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "break", 5, RTT_KEY_WORD, NULL);
- break;
-
- case DKW_CONTINUE:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "continue", 8, RTT_KEY_WORD, NULL);
- break;
-
- }
-
- return line;
-
-}
diff --git a/src/decomp/instr/keyword.h b/src/decomp/instr/keyword.h
deleted file mode 100644
index 4dfcc00..0000000
--- a/src/decomp/instr/keyword.h
+++ /dev/null
@@ -1,68 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * keyword.h - prototypes pour les insertions de mots clefs de haut niveau
- *
- * Copyright (C) 2013 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 _DECOMP_INSTR_KEYWORD_H
-#define _DECOMP_INSTR_KEYWORD_H
-
-
-#include <glib-object.h>
-
-
-#include "../instruction.h"
-
-
-
-#define G_TYPE_KEYWORD_INSTRUCTION g_keyword_instruction_get_type()
-#define G_KEYWORD_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_keyword_instruction_get_type(), GKeywordInstruction))
-#define G_IS_KEYWORD_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_keyword_instruction_get_type()))
-#define G_KEYWORD_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_KEYWORD_INSTRUCTION, GKeywordInstructionClass))
-#define G_IS_KEYWORD_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_KEYWORD_INSTRUCTION))
-#define G_KEYWORD_INSTRUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_KEYWORD_INSTRUCTION, GKeywordInstructionClass))
-
-
-
-/* Type de mots clefs pris en charge */
-typedef enum _DecompiledKeyWord
-{
- DKW_BREAK, /* 'break' */
- DKW_CONTINUE, /* 'continue' */
-
-} DecompiledKeyWord;
-
-
-/* Définition d'un mot clef de haut niveau (instance) */
-typedef struct _GKeywordInstruction GKeywordInstruction;
-
-/* Définition d'un mot clef de haut niveau (classe) */
-typedef struct _GKeywordInstructionClass GKeywordInstructionClass;
-
-
-/* Indique le type défini pour un mot clef de haut niveau. */
-GType g_keyword_instruction_get_type(void);
-
-/* Crée un mot clef de haut niveau. */
-GDecInstruction *g_keyword_instruction_new(DecompiledKeyWord);
-
-
-
-#endif /* _DECOMP_INSTR_KEYWORD_H */
diff --git a/src/decomp/instr/switch.c b/src/decomp/instr/switch.c
deleted file mode 100644
index 468ca82..0000000
--- a/src/decomp/instr/switch.c
+++ /dev/null
@@ -1,380 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * switch.c - décodage des aiguillages multiples du flot d'exécution
- *
- * Copyright (C) 2013 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/>.
- */
-
-
-#include "switch.h"
-
-
-#include <malloc.h>
-#include <stdlib.h>
-
-
-#include "../instruction-int.h"
-
-
-
-/* Détails d'un cas */
-typedef struct _case_info
-{
- vmpa_t addr; /* Adresse des blocs associés */
-
- GDecExpression **values; /* Valeur d'embranchement */
- size_t values_count; /* Quantité de cas rassemblés */
-
- GDecInstruction *instrs; /* Instructions du cas */
-
-} case_info;
-
-
-/* Définition d'un aiguillage multiple du flux d'exécution (instance) */
-struct _GSwitchInstruction
-{
- GDecInstruction parent; /* A laisser en premier */
-
- GDecExpression *value; /* Valeur décidant du flot */
-
- case_info *cases; /* Embranchements présents */
- size_t cases_count; /* Nombre de cas de sélection */
-
- GDecInstruction *def_case; /* Instructions par défaut */
-
-};
-
-
-/* Définition d'un aiguillage multiple du flux d'exécution (classe) */
-struct _GSwitchInstructionClass
-{
- GDecInstructionClass parent; /* A laisser en premier */
-
-};
-
-
-
-/* Initialise la classe des aiguillages de flux d'exécution. */
-static void g_switch_instruction_class_init(GSwitchInstructionClass *);
-
-/* Initialise une instance d'aiguillage du flux d'exécution. */
-static void g_switch_instruction_init(GSwitchInstruction *);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-static bool g_switch_instruction_visit(GSwitchInstruction *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-static bool g_switch_instruction_replace(GSwitchInstruction *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une instruction. */
-static GBufferLine *g_switch_instruction_print(const GSwitchInstruction *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* Indique le type défini pour un aiguillage du flux d'exécution. */
-G_DEFINE_TYPE(GSwitchInstruction, g_switch_instruction, G_TYPE_DEC_INSTRUCTION);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des aiguillages de flux d'exécution. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_switch_instruction_class_init(GSwitchInstructionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'aiguillage du flux d'exécution. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_switch_instruction_init(GSwitchInstruction *instr)
-{
- GDecInstruction *base; /* Autre version de l'objet */
-
- base = G_DEC_INSTRUCTION(instr);
-
- base->visit = (dec_instr_visit_fc)g_switch_instruction_visit;
- base->replace = (dec_instr_replace_fc)g_switch_instruction_replace;
- base->print = (dec_instr_print_fc)g_switch_instruction_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : value = valeur déterminant la voie à suivre. *
-* *
-* Description : Exprime un aiguillage multiple du flux selon une valeur. *
-* *
-* Retour : Instruction mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_switch_instruction_new(GDecExpression *value)
-{
- GSwitchInstruction *result; /* Expression à retourner */
-
- result = g_object_new(G_TYPE_SWITCH_INSTRUCTION, NULL);
-
- result->value = value;
-
- return G_DEC_INSTRUCTION(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = première instruction à venir visiter. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_switch_instruction_visit(GSwitchInstruction *instr, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
-
- result = true;
-
- for (i = 0; i < instr->cases_count && result; i++)
- result = _g_dec_instruction_visit(instr->cases[i].instrs, G_DEC_INSTRUCTION(instr),
- callback, flags, data);
-
- if (result && instr->def_case != NULL)
- result = _g_dec_instruction_visit(instr->def_case, G_DEC_INSTRUCTION(instr),
- callback, flags, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_switch_instruction_replace(GSwitchInstruction *instr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
-
- result = false;
-
- for (i = 0; i < instr->cases_count; i++)
- result |= g_dec_instruction_replace(instr->cases[i].instrs, old, new);
-
- if (instr->def_case != NULL)
- result |= g_dec_instruction_replace(instr->def_case, old, new);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une instruction. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_switch_instruction_print(const GSwitchInstruction *instr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- GBufferLine *result; /* Ligne à retourner */
- size_t i; /* Boucle de parcours #1 */
- size_t j; /* Boucle de parcours #2 */
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "switch", 9, RTT_KEY_WORD, NULL);
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "(", 1, RTT_PUNCT, NULL);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(instr->value), buffer, line, output);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, ")", 1, RTT_PUNCT, NULL);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK, NULL);
-
- g_code_buffer_inc_indentation(buffer);
-
- /* Cas d'aiguillage définis */
-
- for (i = 0; i < instr->cases_count; i++)
- {
- for (j = 0; j < instr->cases[i].values_count; j++)
- {
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "case", 4, RTT_KEY_WORD, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
- result = g_dec_instruction_print(G_DEC_INSTRUCTION(instr->cases[i].values[j])
- , buffer, result, output);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, ":", 1, RTT_PUNCT, NULL);
-
- }
-
- result = g_dec_instruction_print(instr->cases[i].instrs, buffer, result, output);
-
- }
-
- /* Cas par défaut */
-
- if (instr->def_case != NULL)
- {
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "default", 7, RTT_KEY_WORD, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, ":", 1, RTT_PUNCT, NULL);
-
- result = g_dec_instruction_print(instr->def_case, buffer, result, output);
-
- }
-
- /* Clôture */
-
- g_code_buffer_dec_indentation(buffer);
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à compléter avec un nouveau cas. *
-* value = valeur validant l'exécution des instructions. *
-* instrs = instructions associées au cas présenté. *
-* addr = adresse du bloc d'instructions. *
-* *
-* Description : Ajoute un cas d'exécution à l'aiguillage multiple. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_switch_instruction_add_case(GSwitchInstruction *instr, GDecExpression *value, GDecInstruction *instrs, vmpa_t addr)
-{
- case_info *found; /* Cas similaires déjà intégrés*/
-
- found = (case_info *)bsearch(&addr, instr->cases, instr->cases_count, sizeof(case_info),
- (__compar_fn_t)compare_vmpa);
-
- if (found != NULL)
- {
- found->values = (GDecExpression **)realloc(found->values,
- found->values_count++ * sizeof(GDecExpression *));
-
- found->values[found->values_count - 1] = value;
-
- }
- else
- {
- instr->cases = (case_info *)realloc(instr->cases,
- ++instr->cases_count * sizeof(case_info));
-
- instr->cases[instr->cases_count - 1].addr = addr;
- instr->cases[instr->cases_count - 1].values = (GDecExpression **)malloc(sizeof(GDecExpression *));
- instr->cases[instr->cases_count - 1].values_count = 1;
- instr->cases[instr->cases_count - 1].instrs = instrs;
-
- instr->cases[instr->cases_count - 1].values[0] = value;
-
- qsort(instr->cases, instr->cases_count, sizeof(case_info), (__compar_fn_t)compare_vmpa);
-
- }
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à compléter avec un nouveau cas. *
-* instrs = instructions associées au cas présenté. *
-* *
-* Description : Ajoute un cas d'exécution par défaut à l'aiguillage multiple.*
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_switch_instruction_set_default_case(GSwitchInstruction *instr, GDecInstruction *instrs)
-{
- if (instr->def_case != NULL)
- g_object_unref(G_OBJECT(instr->def_case));
-
- instr->def_case = instrs;
-
-}
diff --git a/src/decomp/instr/switch.h b/src/decomp/instr/switch.h
deleted file mode 100644
index 4fe1536..0000000
--- a/src/decomp/instr/switch.h
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * switch.h - prototypes pour les aiguillages multiples du flot d'exécution
- *
- * Copyright (C) 2013 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 _DECOMP_INSTR_SWITCH_H
-#define _DECOMP_INSTR_SWITCH_H
-
-
-#include <glib-object.h>
-
-
-#include "../expression.h"
-#include "../instruction.h"
-
-
-
-#define G_TYPE_SWITCH_INSTRUCTION g_switch_instruction_get_type()
-#define G_SWITCH_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_switch_instruction_get_type(), GSwitchInstruction))
-#define G_IS_SWITCH_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_switch_instruction_get_type()))
-#define G_SWITCH_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_SWITCH_INSTRUCTION, GSwitchInstructionClass))
-#define G_IS_SWITCH_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_SWITCH_INSTRUCTION))
-#define G_SWITCH_INSTRUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_SWITCH_INSTRUCTION, GSwitchInstructionClass))
-
-
-
-/* Définition d'un aiguillage multiple du flux d'exécution (instance) */
-typedef struct _GSwitchInstruction GSwitchInstruction;
-
-/* Définition d'un aiguillage multiple du flux d'exécution (classe) */
-typedef struct _GSwitchInstructionClass GSwitchInstructionClass;
-
-
-/* Indique le type défini pour un multiple aiguillage du flux d'exécution. */
-GType g_switch_instruction_get_type(void);
-
-/* Exprime un aiguillage multiple du flux selon une valeur. */
-GDecInstruction *g_switch_instruction_new(GDecExpression *);
-
-/* Ajoute un cas d'exécution à l'aiguillage multiple. */
-void g_switch_instruction_add_case(GSwitchInstruction *, GDecExpression *, GDecInstruction *, vmpa_t);
-
-/* Ajoute un cas d'exécution par défaut à l'aiguillage multiple. */
-void g_switch_instruction_set_default_case(GSwitchInstruction *, GDecInstruction *);
-
-
-
-#endif /* _DECOMP_INSTR_SWITCH_H */
diff --git a/src/decomp/instruction-int.h b/src/decomp/instruction-int.h
deleted file mode 100644
index f6bb28f..0000000
--- a/src/decomp/instruction-int.h
+++ /dev/null
@@ -1,77 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * instruction-int.h - prototypes pour la définition interne des instructions décompilées
- *
- * Copyright (C) 2010-2013 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 _DECOMP_INSTRUCTION_INT_H
-#define _DECOMP_INSTRUCTION_INT_H
-
-
-#include "instruction.h"
-#include "../arch/archbase.h"
-#include "../common/dllist.h"
-
-
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-typedef bool (* dec_instr_visit_fc) (GDecInstruction *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-/* Remplace une instruction décompilée par une autre. */
-typedef bool (* dec_instr_replace_fc) (GDecInstruction *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une instruction. */
-typedef GBufferLine * (* dec_instr_print_fc) (const GDecInstruction *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-/* Définition d'une instruction décompilée (instance) */
-struct _GDecInstruction
-{
- GObject parent; /* A laisser en premier */
-
- DL_LIST_ITEM(flow); /* Maillon de liste chaînée */
-
- vmpa_t address; /* Position associée */
-
- dec_instr_visit_fc visit; /* Visite des instructions */
- dec_instr_replace_fc replace; /* Remplacement à la volée */
- dec_instr_print_fc print; /* Impression pour à l'écran */
-
-};
-
-
-/* Définition d'une instruction décompilée (classe) */
-struct _GDecInstructionClass
-{
- GObjectClass parent; /* A laisser en premier */
-
-};
-
-
-#define dinstr_list_last(head) dl_list_last(head, GDecInstruction, flow)
-#define dinstr_list_add_tail(new, head) dl_list_add_tail(new, head, GDecInstruction, flow)
-#define dinstr_list_del(item, head) dl_list_del(item, head, GDecInstruction, flow)
-#define dinstr_list_next_iter(iter, head) dl_list_next_iter(iter, head, GDecInstruction, flow)
-#define dinstr_list_prev_iter(iter, head) dl_list_prev_iter(iter, head, GDecInstruction, flow)
-#define dinstr_list_for_each(pos, head) dl_list_for_each(pos, head, GDecInstruction, flow)
-
-
-
-#endif /* _DECOMP_INSTRUCTION_INT_H */
diff --git a/src/decomp/instruction.c b/src/decomp/instruction.c
deleted file mode 100644
index 989a2d9..0000000
--- a/src/decomp/instruction.c
+++ /dev/null
@@ -1,267 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * instruction.c - gestion des instructions décompilées
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "instruction.h"
-
-
-#include "instruction-int.h"
-
-
-
-/* Initialise la classe des instructions décompilées. */
-static void g_dec_instruction_class_init(GDecInstructionClass *);
-
-/* Initialise une instance d'instruction décompilée. */
-static void g_dec_instruction_init(GDecInstruction *);
-
-
-
-/* Indique le type défini pour une instruction décompilée. */
-G_DEFINE_TYPE(GDecInstruction, g_dec_instruction, G_TYPE_OBJECT);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des instructions décompilées. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dec_instruction_class_init(GDecInstructionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'instruction décompilée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dec_instruction_init(GDecInstruction *instr)
-{
- DL_LIST_ITEM_INIT(&instr->flow);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = première instruction à venir visiter. *
-* parent = instruction parente. *
-* callback = procédure à appeler à chaque instruction visitée. *
-* flags = moments des appels à réaliser en retour. *
-* data = données quelconques associées au visiteur. *
-* *
-* Description : Visite un ensemble hiérarchique d'instructions décompilées. *
-* *
-* Retour : true si le parcours a été jusqu'à son terme, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool _g_dec_instruction_visit(GDecInstruction *instr, GDecInstruction *parent, dec_instr_visitor_cb callback, DecInstrVisitFlags flags, void *data)
-{
- bool result; /* Bilan à retourner */
-
- result = true;
-
- if (flags & DVF_ENTER)
- result = callback(instr, parent, DVF_ENTER, data);
-
- if (result && instr->visit)
- result = instr->visit(instr, callback, flags, data);
-
- if (result && (flags & DVF_EXIT))
- result = callback(instr, parent, DVF_EXIT, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = première instruction à venir ausculter. *
-* old = instruction décompilée à venir remplacer. *
-* new = instruction décompilée à utiliser dorénavant. *
-* *
-* Description : Remplace une instruction décompilée par une autre. *
-* *
-* Retour : true si un remplacement a été effectué, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool g_dec_instruction_replace(GDecInstruction *instr, GDecInstruction *old, GDecInstruction *new)
-{
- bool result; /* Bilan à retourner */
-
- if (instr->replace != NULL)
- result = instr->replace(instr, old, new);
- else
- result = false;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à transcrire en version humaine. *
-* buffer = tampon où doit se réaliser l'insertion. *
-* line = ligne d'impression prête à emploi ou NULL. *
-* output = langage de programmation de sortie. *
-* *
-* Description : Imprime pour l'écran un version humaine d'une instruction. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_dec_instruction_print(const GDecInstruction *instr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
-{
- return instr->print(instr, buffer, line, output);
-
-}
-
-
-/* ---------------------------------------------------------------------------------- */
-/* TRAITEMENT DES INSTRUCTIONS PAR ENSEMBLE */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste d'instructions à consulter. *
-* *
-* Description : Fournit la dernière instruction décompilée de l'ensemble. *
-* *
-* Retour : Instruction en queue de liste. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_dec_instruction_get_last(GDecInstruction *list)
-{
- return dinstr_list_last(list);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste d'instructions à compléter, ou NULL. *
-* instr = nouvelle instruction à intégrer à l'ensemble. *
-* *
-* Description : Ajoute une instruction à un ensemble existant. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_instruction_add_to_list(GDecInstruction **list, GDecInstruction *instr)
-{
- dinstr_list_add_tail(instr, list);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste d'instructions à modifier. *
-* instr = instruction à faire disparaître. *
-* *
-* Description : Supprime une instruction de l'ensemble décompilé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_dec_instruction_delete(GDecInstruction **list, GDecInstruction *instr)
-{
- dinstr_list_del(instr, list);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste d'instructions à consulter. *
-* : iter = position actuelle dans la liste. *
-* *
-* Description : Fournit l'élement suivant un autre pour un parcours. *
-* *
-* Retour : Elément suivant ou NULL si aucun. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_dec_instruction_get_next_iter(const GDecInstruction *list, const GDecInstruction *iter)
-{
- return dinstr_list_next_iter(iter, list);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : list = liste d'instructions à consulter. *
-* : iter = position actuelle dans la liste. *
-* *
-* Description : Fournit l'élement précédant un autre pour un parcours. *
-* *
-* Retour : Elément suivant ou NULL si aucun. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_dec_instruction_get_prev_iter(const GDecInstruction *list, const GDecInstruction *iter)
-{
- return dinstr_list_prev_iter(iter, list);
-
-}
diff --git a/src/decomp/instruction.h b/src/decomp/instruction.h
deleted file mode 100644
index 8642edd..0000000
--- a/src/decomp/instruction.h
+++ /dev/null
@@ -1,98 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * instruction.h - prototypes pour la gestion des instructions décompilées
- *
- * Copyright (C) 2010-2013 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 _DECOMP_INSTRUCTION_H
-#define _DECOMP_INSTRUCTION_H
-
-
-#include <glib-object.h>
-
-
-#include "output.h"
-
-
-
-#define G_TYPE_DEC_INSTRUCTION g_dec_instruction_get_type()
-#define G_DEC_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_dec_instruction_get_type(), GDecInstruction))
-#define G_IS_DEC_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_dec_instruction_get_type()))
-#define G_DEC_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DEC_INSTRUCTION, GDecInstructionClass))
-#define G_IS_DEC_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DEC_INSTRUCTION))
-#define G_DEC_INSTRUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DEC_INSTRUCTION, GDecInstructionClass))
-
-
-
-/* Définition d'une instruction décompilée (instance) */
-typedef struct _GDecInstruction GDecInstruction;
-
-/* Définition d'une instruction décompilée (classe) */
-typedef struct _GDecInstructionClass GDecInstructionClass;
-
-/* Position au cours d'une visite */
-typedef enum _DecInstrVisitFlags
-{
- DVF_ENTER = (1 << 0), /* Entrée dans une instruction */
- DVF_EXIT = (1 << 1) /* Sortie d'une instruction */
-
-} DecInstrVisitFlags;
-
-/* Rappel à chaque instruction décompilée visitée */
-typedef bool (* dec_instr_visitor_cb) (GDecInstruction *, GDecInstruction *, DecInstrVisitFlags, void *);
-
-
-/* Indique le type défini pour une instruction décompilée. */
-GType g_dec_instruction_get_type(void);
-
-/* Visite un ensemble hiérarchique d'instructions décompilées. */
-bool _g_dec_instruction_visit(GDecInstruction *, GDecInstruction *, dec_instr_visitor_cb, DecInstrVisitFlags, void *);
-
-#define g_dec_instruction_visit(instr, callback, flags, data) _g_dec_instruction_visit(instr, NULL, callback, flags, data)
-
-/* Remplace une instruction décompilée par une autre. */
-bool g_dec_instruction_replace(GDecInstruction *, GDecInstruction *, GDecInstruction *);
-
-/* Imprime pour l'écran un version humaine d'une expression. */
-GBufferLine *g_dec_instruction_print(const GDecInstruction *, GCodeBuffer *, GBufferLine *, GLangOutput *);
-
-
-
-/* -------------------- TRAITEMENT DES INSTRUCTIONS PAR ENSEMBLE -------------------- */
-
-
-/* Fournit la dernière instruction décompilée de l'ensemble. */
-GDecInstruction *g_dec_instruction_get_last(GDecInstruction *);
-
-/* Ajoute une instruction à un ensemble existant. */
-void g_dec_instruction_add_to_list(GDecInstruction **, GDecInstruction *);
-
-/* Supprime une instruction de l'ensemble décompilé. */
-void g_dec_instruction_delete(GDecInstruction **, GDecInstruction *);
-
-/* Fournit l'élement suivant un autre pour un parcours. */
-GDecInstruction *g_dec_instruction_get_next_iter(const GDecInstruction *, const GDecInstruction *);
-
-/* Fournit l'élement précédant un autre pour un parcours. */
-GDecInstruction *g_dec_instruction_get_prev_iter(const GDecInstruction *, const GDecInstruction *);
-
-
-
-#endif /* _DECOMP_INSTRUCTION_H */
diff --git a/src/decomp/lang/Makefile.am b/src/decomp/lang/Makefile.am
deleted file mode 100755
index 7dc4e21..0000000
--- a/src/decomp/lang/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-
-noinst_LTLIBRARIES = libdecomplang.la
-
-libdecomplang_la_SOURCES = \
- asm.h asm.c \
- java.h java.c
-
-libdecomplang_la_LDFLAGS =
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
diff --git a/src/decomp/lang/asm.c b/src/decomp/lang/asm.c
deleted file mode 100644
index 630a16e..0000000
--- a/src/decomp/lang/asm.c
+++ /dev/null
@@ -1,298 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * asm.c - sorties en langage d'assemblage
- *
- * Copyright (C) 2010-2012 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/>.
- */
-
-
-#include "asm.h"
-
-
-#include "../output-int.h"
-#include "../../analysis/type.h" /* TODO : remme */
-
-
-
-/* Sortie selon le langage d'assemblage (instance) */
-struct _GAsmOutput
-{
- GLangOutput parent; /* A laisser en premier */
-
-};
-
-
-/* Sortie selon le langage d'assemblage (classe) */
-struct _GAsmOutputClass
-{
- GLangOutputClass parent; /* A laisser en premier */
-
-};
-
-
-/* Initialise la classe des sorties en langage d'assemblage. */
-static void g_asm_output_class_init(GAsmOutputClass *);
-
-/* Initialise une instance de sortie en langage d'assemblage. */
-static void g_asm_output_init(GAsmOutput *);
-
-/* Ajoute un commentaire à un tampon donné. */
-static GBufferLine *g_asm_output_write_comments(GAsmOutput *, GCodeBuffer *, const char *, size_t);
-
-/* Imprime dans un tampon donné une méthode de comparaison. */
-static void g_asm_output_write_comp_sign(GAsmOutput *, GBufferLine *, CompSignType);
-
-/* Débute la documentation d'une routine. */
-static GBufferLine *g_asm_output_start_routine_info(const GAsmOutput *, GCodeBuffer *);
-
-/* Débute la définition d'une routine. */
-static GBufferLine *g_asm_output_start_routine_prototype(GAsmOutput *, GCodeBuffer *, const GDataType *);
-
-/* Termine la définition d'une routine. */
-static void g_asm_output_end_routine_prototype(GAsmOutput *, GCodeBuffer *, GBufferLine *);
-
-
-
-/* Indique le type défini pour une sortie en langage d'assemblage. */
-G_DEFINE_TYPE(GAsmOutput, g_asm_output, G_TYPE_LANG_OUTPUT);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des sorties en langage d'assemblage. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_asm_output_class_init(GAsmOutputClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = instance à initialiser. *
-* *
-* Description : Initialise une instance de sortie en langage d'assemblage. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_asm_output_init(GAsmOutput *output)
-{
- GLangOutput *lang; /* Autre version de l'objet */
-
- lang = G_LANG_OUTPUT(output);
-
- lang->cont_comments = (write_comments_fc)g_asm_output_write_comments;
- lang->write_comments = (write_comments_fc)g_asm_output_write_comments;
-
- lang->comp_sign = (write_comp_sign_fc)g_asm_output_write_comp_sign;
-
- lang->start_info = (start_rtn_info_fc)g_asm_output_start_routine_info;
-
- lang->start_routine_proto = (rlgbuftp_fc)g_asm_output_start_routine_prototype;
- lang->end_routine_proto = (lgbufln_fc)g_asm_output_end_routine_prototype;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Crée une nouvelle sortie en langage d'assemblage. *
-* *
-* Retour : Imprimeur créé. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GLangOutput *g_asm_output_new(void)
-{
- GBufferLine *result; /* Composant à retourner */
-
- result = g_object_new(G_TYPE_ASM_OUTPUT, NULL);
-
- return G_LANG_OUTPUT(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* text = texte à insérer dans l'existant. *
-* length = taille du texte à traiter. *
-* *
-* Description : Ajoute un commentaire à un tampon donné. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_asm_output_write_comments(GAsmOutput *output, GCodeBuffer *buffer, const char *text, size_t length)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_COMMENTS, "; ", 2, RTT_COMMENT, NULL);
-
- if (length > 0)
- g_buffer_line_append_text(result, BLC_COMMENTS, text, length, RTT_COMMENT, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* line = tampon de sortie à disposition. *
-* sign = méthode de comparaison à imprimer. *
-* *
-* Description : Imprime dans un tampon donné une méthode de comparaison. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_asm_output_write_comp_sign(GAsmOutput *output, GBufferLine *line, CompSignType sign)
-{
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
- switch (sign)
- {
- case CST_EQ:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "==", 2, RTT_SIGNS, NULL);
- break;
- case CST_NE:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "!=", 2, RTT_SIGNS, NULL);
- break;
- case CST_LT:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "<", 1, RTT_SIGNS, NULL);
- break;
- case CST_GE:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ">=", 2, RTT_SIGNS, NULL);
- break;
- case CST_GT:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ">", 1, RTT_SIGNS, NULL);
- break;
- case CST_LE:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "<=", 2, RTT_SIGNS, NULL);
- break;
- default:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "?", 1, RTT_SIGNS, NULL);
- break;
- }
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Débute la documentation d'une routine. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_asm_output_start_routine_info(const GAsmOutput *output, GCodeBuffer *buffer)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "; ", 2, RTT_COMMENT, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* ret = type de retour de la routine traitée. *
-* *
-* Description : Débute la définition d'une routine. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_asm_output_start_routine_prototype(GAsmOutput *output, GCodeBuffer *buffer, const GDataType *ret)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- /* TODO */
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "XXX", 3, RTT_COMMENT, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* *
-* Description : Termine la définition d'une routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_asm_output_end_routine_prototype(GAsmOutput *output, GCodeBuffer *buffer, GBufferLine *line)
-{
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ";", 1, RTT_COMMENT, NULL);
-
-}
diff --git a/src/decomp/lang/asm.h b/src/decomp/lang/asm.h
deleted file mode 100644
index d050390..0000000
--- a/src/decomp/lang/asm.h
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * asm.h - prototypes pour les sorties en langage d'assemblage
- *
- * Copyright (C) 2010 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 _DECOMP_LANG_ASM_H
-#define _DECOMP_LANG_ASM_H
-
-
-#include "../output.h"
-
-
-
-#define G_TYPE_ASM_OUTPUT g_asm_output_get_type()
-#define G_ASM_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_asm_output_get_type(), GAsmOutput))
-#define G_IS_ASM_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_asm_output_get_type()))
-#define G_ASM_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ASM_OUTPUT, GAsmOutputClass))
-#define G_IS_ASM_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ASM_OUTPUT))
-#define G_ASM_OUTPUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ASM_OUTPUT, GAsmOutputClass))
-
-
-/* Sortie selon le langage d'assemblage (instance) */
-typedef struct _GAsmOutput GAsmOutput;
-
-/* Sortie selon le langage d'assemblage (classe) */
-typedef struct _GAsmOutputClass GAsmOutputClass;
-
-
-/* Indique le type défini pour une sortie en langage d'assemblage. */
-GType g_asm_output_get_type(void);
-
-/* Crée une nouvelle sortie en langage d'assemblage. */
-GLangOutput *g_asm_output_new(void);
-
-
-
-#endif /* _DECOMP_LANG_ASM_H */
diff --git a/src/decomp/lang/java.c b/src/decomp/lang/java.c
deleted file mode 100644
index b12d87f..0000000
--- a/src/decomp/lang/java.c
+++ /dev/null
@@ -1,652 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * java.c - sorties en langage Java
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "java.h"
-
-
-#include "../output-int.h"
-#include "../../analysis/type.h" /* TODO : remme */
-
-
-
-/* Sortie selon le langage Java (instance) */
-struct _GJavaOutput
-{
- GLangOutput parent; /* A laisser en premier */
-
-};
-
-
-/* Sortie selon le langage Java (classe) */
-struct _GJavaOutputClass
-{
- GLangOutputClass parent; /* A laisser en premier */
-
-};
-
-
-/* Initialise la classe des sorties en langage Java. */
-static void g_java_output_class_init(GJavaOutputClass *);
-
-/* Initialise une instance de sortie en langage Java. */
-static void g_java_output_init(GJavaOutput *);
-
-/* Marque le début d'une série de commentaires. */
-static GBufferLine *g_java_output_start_comments(GJavaOutput *, GCodeBuffer *);
-
-/* Poursuit l'ajout d'une ligne de commentaires. */
-static GBufferLine *g_java_output_continue_comments(GJavaOutput *, GCodeBuffer *, const char *, size_t);
-
-/* Marque la fin d'une série de commentaires. */
-static GBufferLine *g_java_output_end_comments(GJavaOutput *, GCodeBuffer *);
-
-/* Ajoute un commentaire à un tampon donné. */
-static GBufferLine *g_java_output_write_comments(GJavaOutput *, GCodeBuffer *, const char *, size_t);
-
-/* Imprime dans un tampon donné une méthode de comparaison. */
-static void g_java_output_write_comp_sign(GJavaOutput *, GBufferLine *, CompSignType);
-
-/* Imprime dans un tampon donné un opérateur logique. */
-static void g_java_output_write_cond_operator(GLangOutput *, GBufferLine *, CondOperatorType);
-
-/* Débute la définition d'une classe. */
-static GBufferLine *g_java_output_start_class(GJavaOutput *, GCodeBuffer *, const GDataType *);
-
-/* Termine la définition d'une classe. */
-static void g_java_output_end_class(GJavaOutput *, GCodeBuffer *);
-
-/* Débute la définition d'une routine. */
-static GBufferLine *g_java_output_start_routine_prototype(GJavaOutput *, GCodeBuffer *, const GDataType *);
-
-/* Termine la définition d'une routine. */
-static void g_java_output_end_routine_prototype(GJavaOutput *, GCodeBuffer *, GBufferLine *);
-
-/* Commence la définition du corps d'une routine. */
-static void g_java_output_start_routine_body(GJavaOutput *, GCodeBuffer *, GBufferLine *);
-
-/* Termine la définition du corps d'une routine. */
-static void g_java_output_end_routine_body(GJavaOutput *, GCodeBuffer *);
-
-/* Commence la définition d'un bloc de code. */
-static GBufferLine *g_java_output_start_code_block(GJavaOutput *, GCodeBuffer *, GBufferLine *, size_t);
-
-/* Termine la définition d'un bloc de code. */
-static GBufferLine *g_java_output_end_code_block(GJavaOutput *, GCodeBuffer *, GBufferLine *, size_t);
-
-/* Emballe une expression conditionelle. */
-static GBufferLine *g_java_output_encapsulate_condition(GLangOutput *, GCodeBuffer *, GBufferLine *, bool);
-
-
-
-/* Indique le type défini pour une sortie en langage Java. */
-G_DEFINE_TYPE(GJavaOutput, g_java_output, G_TYPE_LANG_OUTPUT);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des sorties en langage Java. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_java_output_class_init(GJavaOutputClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = instance à initialiser. *
-* *
-* Description : Initialise une instance de sortie en langage Java. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_java_output_init(GJavaOutput *output)
-{
- GLangOutput *lang; /* Autre version de l'objet */
-
- lang = G_LANG_OUTPUT(output);
-
-
- lang->start_comments = (rlgbuf_fc)g_java_output_start_comments;
- lang->cont_comments = (write_comments_fc)g_java_output_continue_comments;
- lang->end_comments = (rlgbuf_fc)g_java_output_end_comments;
- lang->write_comments = (write_comments_fc)g_java_output_write_comments;
-
- lang->comp_sign = (write_comp_sign_fc)g_java_output_write_comp_sign;
- lang->cond_op = (write_cond_op_fc)g_java_output_write_cond_operator;
-
- lang->start_class = (rlgbuftp_fc)g_java_output_start_class;
- lang->end_class = (lgbuf_fc)g_java_output_end_class;
-
- lang->start_routine_proto = (rlgbuftp_fc)g_java_output_start_routine_prototype;
- lang->end_routine_proto = (lgbufln_fc)g_java_output_end_routine_prototype;
- lang->start_routine_body = (lgbufln_fc)g_java_output_start_routine_body;
- lang->end_routine_body = (lgbuf_fc)g_java_output_end_routine_body;
-
- lang->start_code_block = (rlgbuflnsz_fc)g_java_output_start_code_block;
- lang->end_code_block = (rlgbuflnsz_fc)g_java_output_end_code_block;
- lang->encaps_cond = (lo_buf_ln_bool_fc)g_java_output_encapsulate_condition;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Crée une nouvelle sortie en langage Java. *
-* *
-* Retour : Imprimeur créé. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GLangOutput *g_java_output_new(void)
-{
- GBufferLine *result; /* Composant à retourner */
-
- result = g_object_new(G_TYPE_JAVA_OUTPUT, NULL);
-
- return G_LANG_OUTPUT(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Marque le début d'une série de commentaires. *
-* *
-* Retour : Nouvelle ligne constituée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_start_comments(GJavaOutput *output, GCodeBuffer *buffer)
-{
- GBufferLine *result; /* Nouvelle ligne à retourner */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_COMMENTS, "/**", 3, RTT_COMMENT, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* text = texte à insérer dans l'existant. *
-* length = taille du texte à traiter. *
-* *
-* Description : Poursuit l'ajout d'une ligne de commentaires. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_continue_comments(GJavaOutput *output, GCodeBuffer *buffer, const char *text, size_t length)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_COMMENTS, " * ", 3, RTT_COMMENT, NULL);
-
- if (length > 0)
- g_buffer_line_append_text(result, BLC_COMMENTS, text, length, RTT_COMMENT, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Marque la fin d'une série de commentaires. *
-* *
-* Retour : Nouvelle ligne constituée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_end_comments(GJavaOutput *output, GCodeBuffer *buffer)
-{
- GBufferLine *result; /* Nouvelle ligne à retourner */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_COMMENTS, " */", 3, RTT_COMMENT, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* text = texte à insérer dans l'existant. *
-* length = taille du texte à traiter. *
-* *
-* Description : Ajoute un commentaire à un tampon donné. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_write_comments(GJavaOutput *output, GCodeBuffer *buffer, const char *text, size_t length)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_COMMENTS, "// ", 3, RTT_COMMENT, NULL);
-
- if (length > 0)
- g_buffer_line_append_text(result, BLC_COMMENTS, text, length, RTT_COMMENT, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* line = tampon de sortie à disposition. *
-* sign = méthode de comparaison à imprimer. *
-* *
-* Description : Imprime dans un tampon donné une méthode de comparaison. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_java_output_write_comp_sign(GJavaOutput *output, GBufferLine *line, CompSignType sign)
-{
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
- switch (sign)
- {
- case CST_EQ:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "==", 2, RTT_SIGNS, NULL);
- break;
- case CST_NE:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "!=", 2, RTT_SIGNS, NULL);
- break;
- case CST_LT:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "<", 1, RTT_SIGNS, NULL);
- break;
- case CST_GE:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ">=", 2, RTT_SIGNS, NULL);
- break;
- case CST_GT:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ">", 1, RTT_SIGNS, NULL);
- break;
- case CST_LE:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "<=", 2, RTT_SIGNS, NULL);
- break;
- default:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "?", 1, RTT_SIGNS, NULL);
- break;
- }
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* line = tampon de sortie à disposition. *
-* op = opérateur logique à imprimer. *
-* *
-* Description : Imprime dans un tampon donné un opérateur logique. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_java_output_write_cond_operator(GLangOutput *output, GBufferLine *line, CondOperatorType op)
-{
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
- switch (op)
- {
- case COT_AND:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "&&", 2, RTT_SIGNS, NULL);
- break;
- case COT_OR:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "||", 2, RTT_SIGNS, NULL);
- break;
- default:
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "??", 2, RTT_SIGNS, NULL);
- break;
- }
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* type = désignation de la classe à définir. *
-* *
-* Description : Débute la définition d'une classe. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_start_class(GJavaOutput *output, GCodeBuffer *buffer, const GDataType *type)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
- char *name; /* Désignation humaine */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "class", 5, RTT_KEY_WORD, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
-
- name = _g_data_type_to_string(type, true);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, name, strlen(name), RTT_RAW, NULL);
- free(name);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK, NULL);
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_code_buffer_inc_indentation(buffer);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Termine la définition d'une classe. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_java_output_end_class(GJavaOutput *output, GCodeBuffer *buffer)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- g_code_buffer_dec_indentation(buffer);
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK, NULL);
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* ret = type de retour de la routine traitée. *
-* *
-* Description : Débute la définition d'une routine. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_start_routine_prototype(GJavaOutput *output, GCodeBuffer *buffer, const GDataType *ret)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- /* TODO */
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "XXX", 3, RTT_RAW, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* *
-* Description : Termine la définition d'une routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_java_output_end_routine_prototype(GJavaOutput *output, GCodeBuffer *buffer, GBufferLine *line)
-{
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ";", 1, RTT_PUNCT, NULL);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* *
-* Description : Commence la définition du corps d'une routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_java_output_start_routine_body(GJavaOutput *output, GCodeBuffer *buffer, GBufferLine *line)
-{
- /*
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK, NULL);
-
- g_code_buffer_inc_indentation(buffer);
- */
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Termine la définition du corps d'une routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_java_output_end_routine_body(GJavaOutput *output, GCodeBuffer *buffer)
-{
- GBufferLine *line; /* Nouvelle ligne à constituer */
- /*
- g_code_buffer_dec_indentation(buffer);
-
- line = g_code_buffer_append_new_line_fixme(buffer);
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK, NULL);
- */
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* count = nombre d'éléments du bloc. *
-* *
-* Description : Commence la définition d'un bloc de code. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_start_code_block(GJavaOutput *output, GCodeBuffer *buffer, GBufferLine *line, size_t count)
-{
- GBufferLine *result; /* Nouvelle ligne à utiliser */
-
- if (count > 1)
- {
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
- g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK, NULL);
- }
-
- g_code_buffer_inc_indentation(buffer);
-
- result = g_code_buffer_append_new_line_fixme(buffer); /* FIXME : n° de ligne */
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* count = nombre d'éléments du bloc. *
-* *
-* Description : Termine la définition d'un bloc de code. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_end_code_block(GJavaOutput *output, GCodeBuffer *buffer, GBufferLine *line, size_t count)
-{
- GBufferLine *result; /* Nouvelle ligne à constituer */
-
- g_code_buffer_dec_indentation(buffer);
-
- result = g_code_buffer_append_new_line_fixme(buffer);
-
- if (count > 1)
- {
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée.*
-* opening = précise si la condition débute ou se termine. *
-* *
-* Description : Emballe une expression conditionelle. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GBufferLine *g_java_output_encapsulate_condition(GLangOutput *output, GCodeBuffer *buffer, GBufferLine *line, bool opening)
-{
- GBufferLine *result; /* Nouvelle ligne à utiliser */
-
- result = line;
-
- if (opening)
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "(", 1, RTT_HOOK, NULL);
- else
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, ")", 1, RTT_HOOK, NULL);
-
- return result;
-
-}
diff --git a/src/decomp/lang/java.h b/src/decomp/lang/java.h
deleted file mode 100644
index 1b9c013..0000000
--- a/src/decomp/lang/java.h
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * java.h - prototypes pour les sorties en langage Java
- *
- * Copyright (C) 2010 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 _DECOMP_LANG_JAVA_H
-#define _DECOMP_LANG_JAVA_H
-
-
-#include "../output.h"
-
-
-
-#define G_TYPE_JAVA_OUTPUT g_java_output_get_type()
-#define G_JAVA_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_java_output_get_type(), GJavaOutput))
-#define G_IS_JAVA_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_java_output_get_type()))
-#define G_JAVA_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_JAVA_OUTPUT, GJavaOutputClass))
-#define G_IS_JAVA_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_JAVA_OUTPUT))
-#define G_JAVA_OUTPUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_JAVA_OUTPUT, GJavaOutputClass))
-
-
-/* Sortie selon le langage Java (instance) */
-typedef struct _GJavaOutput GJavaOutput;
-
-/* Sortie selon le langage Java (classe) */
-typedef struct _GJavaOutputClass GJavaOutputClass;
-
-
-/* Indique le type défini pour une sortie en langage Java. */
-GType g_java_output_get_type(void);
-
-/* Crée une nouvelle sortie en langage Java. */
-GLangOutput *g_java_output_new(void);
-
-
-
-#endif /* _DECOMP_LANG_JAVA_H */
diff --git a/src/decomp/output-int.h b/src/decomp/output-int.h
deleted file mode 100644
index b593ae9..0000000
--- a/src/decomp/output-int.h
+++ /dev/null
@@ -1,106 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * output-int.h - définitions internes pour les sorties en langage de programmation
- *
- * Copyright (C) 2010-2013 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 _DECOMP_OUTPUT_INT_H
-#define _DECOMP_OUTPUT_INT_H
-
-
-#include "output.h"
-
-
-
-/* Xxx. */
-typedef GBufferLine * (* rlgbuf_fc) (GLangOutput *, GCodeBuffer *);
-
-/* Ajoute un commentaire à un tampon donné. */
-typedef GBufferLine * (* write_comments_fc) (GLangOutput *, GCodeBuffer *, const char *, size_t);
-
-/* Imprime dans un tampon donné une méthode de comparaison. */
-typedef void (* write_comp_sign_fc) (GLangOutput *, GBufferLine *, CompSignType);
-
-/* Imprime dans un tampon donné un opérateur logique. */
-typedef void (* write_cond_op_fc) (GLangOutput *, GBufferLine *, CondOperatorType);
-
-/* Débute la documentation d'une routine. */
-typedef GBufferLine * (* start_rtn_info_fc) (const GLangOutput *, GCodeBuffer *);
-
-/* Xxx. */
-typedef GBufferLine * (* rlgbuftp_fc) (GLangOutput *, GCodeBuffer *, const void /*GDataType*/ *);
-
-/* Xxx. */
-typedef void (* lgbuf_fc) (GLangOutput *, GCodeBuffer *);
-
-/* Xxx. */
-typedef void (* lgbufln_fc) (GLangOutput *, GCodeBuffer *, GBufferLine *);
-
-/* Xxx. */
-typedef GBufferLine * (* rlgbufln_fc) (GLangOutput *, GCodeBuffer *, GBufferLine *);
-
-/* Xxx. */
-typedef GBufferLine * (* rlgbuflnsz_fc) (GLangOutput *, GCodeBuffer *, GBufferLine *, size_t);
-
-
-/* Xxx. */
-typedef GBufferLine * (* lo_buf_ln_bool_fc) (GLangOutput *, GCodeBuffer *, GBufferLine *, bool);
-
-
-
-/* Sortie selon un langage de programmation (instance) */
-struct _GLangOutput
-{
- GObject parent; /* A laisser en premier */
-
- rlgbuf_fc start_comments; /* Plusieurs commentaires (#1) */
- write_comments_fc cont_comments; /* Plusieurs commentaires (#2) */
- rlgbuf_fc end_comments; /* Plusieurs commentaires (#3) */
- write_comments_fc write_comments; /* Commentaires sur une ligne */
-
- write_comp_sign_fc comp_sign; /* Méthde de comparaison */
- write_cond_op_fc cond_op; /* Opérateur logique */
-
- rlgbuftp_fc start_class; /* Début de définition */
- lgbuf_fc end_class; /* Fin de définition de classe */
-
- start_rtn_info_fc start_info; /* Début de documentation */
-
- rlgbuftp_fc start_routine_proto; /* Début de prototype */
- lgbufln_fc end_routine_proto; /* Fin de prototype */
- lgbufln_fc start_routine_body; /* Début de définition */
- lgbuf_fc end_routine_body; /* Fin de définition de corps */
- rlgbuflnsz_fc start_code_block; /* Début de définition */
- rlgbuflnsz_fc end_code_block; /* Fin de définition de corps */
- lo_buf_ln_bool_fc encaps_cond; /* Emballe une condition */
-
-};
-
-
-/* Sortie selon un langage de programmation (classe) */
-struct _GLangOutputClass
-{
- GObjectClass parent; /* A laisser en premier */
-
-};
-
-
-
-#endif /* _DECOMP_OUTPUT_INT_H */
diff --git a/src/decomp/output.c b/src/decomp/output.c
deleted file mode 100644
index 52bf9f7..0000000
--- a/src/decomp/output.c
+++ /dev/null
@@ -1,483 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * output.c - sorties en langage de programmation
- *
- * Copyright (C) 2010-2013 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/>.
- */
-
-
-#include "output.h"
-
-
-#include "output-int.h"
-#include "../analysis/type.h" /* TODO : remme */
-
-
-
-/* Indique le type défini pour une sortie de langage de programmation. */
-G_DEFINE_TYPE(GLangOutput, g_lang_output, G_TYPE_OBJECT);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des sorties en langage de programmation.*
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_lang_output_class_init(GLangOutputClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = instance à initialiser. *
-* *
-* Description : Initialise une instance de sortie en langage de prog. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_lang_output_init(GLangOutput *output)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Marque le début d'une série de commentaires. *
-* *
-* Retour : Nouvelle ligne constituée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_start_comments(GLangOutput *output, GCodeBuffer *buffer)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- if (output->start_comments != NULL)
- result = output->start_comments(output, buffer);
-
- else result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* text = texte à insérer dans l'existant. *
-* length = taille du texte à traiter. *
-* *
-* Description : Poursuit l'ajout d'une ligne de commentaires. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_continue_comments(GLangOutput *output, GCodeBuffer *buffer, const char *text, size_t length)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- if (output->cont_comments != NULL)
- result = output->cont_comments(output, buffer, text, length);
-
- else result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Marque la fin d'une série de commentaires. *
-* *
-* Retour : Nouvelle ligne constituée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_end_comments(GLangOutput *output, GCodeBuffer *buffer)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- if (output->end_comments != NULL)
- result = output->end_comments(output, buffer);
-
- else result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* text = texte à insérer dans l'existant. *
-* length = taille du texte à traiter. *
-* *
-* Description : Ajoute un commentaire à un tampon donné. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_write_comments(GLangOutput *output, GCodeBuffer *buffer, const char *text, size_t length)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- if (output->write_comments != NULL)
- result = output->write_comments(output, buffer, text, length);
-
- else result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* line = tampon de sortie à disposition. *
-* sign = méthode de comparaison à imprimer. *
-* *
-* Description : Imprime dans un tampon donné une méthode de comparaison. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_lang_output_write_comp_sign(GLangOutput *output, GBufferLine *line, CompSignType sign)
-{
- if (output->comp_sign != NULL)
- output->comp_sign(output, line, sign);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* line = tampon de sortie à disposition. *
-* op = opérateur logique à imprimer. *
-* *
-* Description : Imprime dans un tampon donné un opérateur logique. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_lang_output_write_cond_operator(GLangOutput *output, GBufferLine *line, CondOperatorType op)
-{
- if (output->cond_op != NULL)
- output->cond_op(output, line, op);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* type = désignation de la classe à définir. *
-* *
-* Description : Débute la définition d'une classe. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_start_class(GLangOutput *output, GCodeBuffer *buffer, const void *type)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- if (output->start_class != NULL)
- result = output->start_class(output, buffer, (const GDataType *)type);
-
- else result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Termine la définition d'une classe. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_lang_output_end_class(GLangOutput *output, GCodeBuffer *buffer)
-{
- if (output->end_class != NULL)
- output->end_class(output, buffer);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Débute la documentation d'une routine. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_start_routine_info(const GLangOutput *output, GCodeBuffer *buffer)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- if (output->start_routine_proto != NULL)
- {
- result = output->start_info(output, buffer);
- g_buffer_line_start_merge_at(result, BLC_LAST_USED);
- }
- else result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* ret = type de retour de la routine traitée. *
-* *
-* Description : Débute la définition d'une routine. *
-* *
-* Retour : Ligne nouvellement créée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_start_routine_prototype(GLangOutput *output, GCodeBuffer *buffer, const void *ret)
-{
- GBufferLine *result; /* Adresse nouvelle à remonter */
-
- if (output->start_routine_proto != NULL)
- result = output->start_routine_proto(output, buffer, ret);
-
- else result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* *
-* Description : Termine la définition d'une routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_lang_output_end_routine_prototype(GLangOutput *output, GCodeBuffer *buffer, GBufferLine *line)
-{
- if (output->end_routine_proto != NULL)
- output->end_routine_proto(output, buffer, line);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* *
-* Description : Commence la définition du corps d'une routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_lang_output_start_routine_body(GLangOutput *output, GCodeBuffer *buffer, GBufferLine *line)
-{
- if (output->start_routine_body != NULL)
- output->start_routine_body(output, buffer, line);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* *
-* Description : Termine la définition du corps d'une routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_lang_output_end_routine_body(GLangOutput *output, GCodeBuffer *buffer)
-{
- if (output->end_routine_body != NULL)
- output->end_routine_body(output, buffer);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* count = nombre d'éléments du bloc. *
-* *
-* Description : Commence la définition d'un bloc de code. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_start_code_block(GLangOutput *output, GCodeBuffer *buffer, GBufferLine *line, size_t count)
-{
- GBufferLine *result; /* Nouvelle ligne à utiliser */
-
- if (output->start_code_block != NULL)
- result = output->start_code_block(output, buffer, line, count);
- else
- result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée. *
-* count = nombre d'éléments du bloc. *
-* *
-* Description : Termine la définition d'un bloc de code. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_end_code_block(GLangOutput *output, GCodeBuffer *buffer, GBufferLine *line, size_t count)
-{
- GBufferLine *result; /* Nouvelle ligne à utiliser */
-
- if (output->end_code_block != NULL)
- result = output->end_code_block(output, buffer, line, count);
- else
- result = NULL;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : output = encadrant de l'impression en langage de prog. *
-* buffer = tampon de sortie à disposition. *
-* line = ligne contenant le prototype de la routine traitée.*
-* opening = précise si la condition débute ou se termine. *
-* *
-* Description : Emballe une expression conditionelle. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBufferLine *g_lang_output_encapsulate_condition(GLangOutput *output, GCodeBuffer *buffer, GBufferLine *line, bool opening)
-{
- GBufferLine *result; /* Nouvelle ligne à utiliser */
-
- if (output->encaps_cond != NULL)
- result = output->encaps_cond(output, buffer, line, opening);
- else
- result = NULL;
-
- return result;
-
-}
diff --git a/src/decomp/output.h b/src/decomp/output.h
deleted file mode 100644
index 4951d29..0000000
--- a/src/decomp/output.h
+++ /dev/null
@@ -1,134 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * output.h - prototypes pour les sorties en langage de programmation
- *
- * Copyright (C) 2010-2013 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 _DECOMP_OUTPUT_H
-#define _DECOMP_OUTPUT_H
-
-
-#include "../glibext/gcodebuffer.h"
-
-
-
-#define G_TYPE_LANG_OUTPUT g_lang_output_get_type()
-#define G_LANG_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_lang_output_get_type(), GLangOutput))
-#define G_IS_LANG_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_lang_output_get_type()))
-#define G_LANG_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_LANG_OUTPUT, GLangOutputClass))
-#define G_IS_LANG_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_LANG_OUTPUT))
-#define G_LANG_OUTPUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_LANG_OUTPUT, GLangOutputClass))
-
-
-/* Sortie selon un langage de programmation (instance) */
-typedef struct _GLangOutput GLangOutput;
-
-/* Sortie selon un langage de programmation (classe) */
-typedef struct _GLangOutputClass GLangOutputClass;
-
-
-/* Indique le type défini pour une sortie de langage de programmation. */
-GType g_lang_output_get_type(void);
-
-/* Marque le début d'une série de commentaires. */
-GBufferLine *g_lang_output_start_comments(GLangOutput *, GCodeBuffer *);
-
-/* Poursuit l'ajout d'une ligne de commentaires. */
-GBufferLine *g_lang_output_continue_comments(GLangOutput *, GCodeBuffer *, const char *, size_t);
-
-/* Marque la fin d'une série de commentaires. */
-GBufferLine *g_lang_output_end_comments(GLangOutput *, GCodeBuffer *);
-
-/* Ajoute un commentaire à un tampon donné. */
-GBufferLine *g_lang_output_write_comments(GLangOutput *, GCodeBuffer *, const char *, size_t);
-
-
-/* Liste des signes binaires de comparaison */
-typedef enum _CompSignType
-{
- CST_EQ, /* == */
- CST_NE, /* != */
- CST_LT, /* < */
- CST_GE, /* >= */
- CST_GT, /* > */
- CST_LE, /* <= */
-
- CST_COUNT
-
-} CompSignType;
-
-/* Liste des signes binaires de comparaison */
-typedef enum _CondOperatorType
-{
- COT_NONE, /* pas de condition */
- COT_AND, /* && */
- COT_OR, /* || */
-
- COT_COUNT
-
-} CondOperatorType;
-
-
-/* Imprime dans un tampon donné une méthode de comparaison. */
-void g_lang_output_write_comp_sign(GLangOutput *, GBufferLine *, CompSignType);
-
-/* Imprime dans un tampon donné un opérateur logique. */
-void g_lang_output_write_cond_operator(GLangOutput *, GBufferLine *, CondOperatorType);
-
-
-/* Débute la définition d'une classe. */
-GBufferLine *g_lang_output_start_class(GLangOutput *, GCodeBuffer *, const void *);
-
-/* Termine la définition d'une classe. */
-void g_lang_output_end_class(GLangOutput *, GCodeBuffer *);
-
-/* Débute la documentation d'une routine. */
-GBufferLine *g_lang_output_start_routine_info(const GLangOutput *, GCodeBuffer *);
-
-/* Définit le prototype d'une routine. */
-GBufferLine *g_lang_output_start_routine_prototype(GLangOutput *, GCodeBuffer *, const void *);
-
-/* Marque la fin du prototype d'une routine. */
-void g_lang_output_end_routine_prototype(GLangOutput *, GCodeBuffer *, GBufferLine *);
-
-/* Commence la définition du corps d'une routine. */
-void g_lang_output_start_routine_body(GLangOutput *, GCodeBuffer *, GBufferLine *);
-
-/* Termine la définition du corps d'une routine. */
-void g_lang_output_end_routine_body(GLangOutput *, GCodeBuffer *);
-
-/* Commence la définition d'un bloc de code. */
-GBufferLine *g_lang_output_start_code_block(GLangOutput *, GCodeBuffer *, GBufferLine *, size_t);
-
-/* Termine la définition d'un bloc de code. */
-GBufferLine *g_lang_output_end_code_block(GLangOutput *, GCodeBuffer *, GBufferLine *, size_t);
-
-/* Emballe une expression conditionelle. */
-GBufferLine *g_lang_output_encapsulate_condition(GLangOutput *, GCodeBuffer *, GBufferLine *, bool);
-
-
-
-typedef unsigned int lang_t;
-
-#include "lang/java.h"
-
-
-
-#endif /* _DECOMP_OUTPUT_H */