summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-12-12 18:38:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-12-12 18:38:53 (GMT)
commit3754a5e3edeea98ce426b65772708ae91b291c1f (patch)
treee292aa254f59e61f6f9672b826f08be6f428ffdd
parentdcc0438ff24efd5958b8d46940eb395ff2b7ed77 (diff)
Removed most of the code related to non-working decompilation.
-rw-r--r--ChangeLog119
-rw-r--r--configure.ac6
-rw-r--r--src/Makefile.am3
-rwxr-xr-xsrc/analysis/Makefile.am5
-rw-r--r--src/analysis/binary.c3
-rw-r--r--src/analysis/disass/disassembler.c4
-rw-r--r--src/analysis/disass/output.c6
-rw-r--r--src/analysis/routine.c14
-rw-r--r--src/analysis/routine.h9
-rw-r--r--src/analysis/type-int.h4
-rw-r--r--src/analysis/type.c3
-rw-r--r--src/analysis/type.h3
-rw-r--r--src/analysis/types/basic.c7
-rw-r--r--src/analysis/types/cse-int.h2
-rw-r--r--src/analysis/types/cse.c5
-rw-r--r--src/analysis/types/encaps.c7
-rw-r--r--src/analysis/types/literal.c7
-rw-r--r--src/analysis/types/template.c7
-rw-r--r--src/analysis/variable.c4
-rw-r--r--src/analysis/variable.h2
-rw-r--r--src/arch/arm/context.c7
-rw-r--r--src/arch/arm/context.h3
-rw-r--r--src/arch/dalvik/Makefile.am3
-rw-r--r--src/arch/dalvik/context.c6
-rw-r--r--src/arch/dalvik/context.h3
-rw-r--r--src/arch/dalvik/decomp/Makefile.am27
-rw-r--r--src/arch/dalvik/decomp/aget.c71
-rw-r--r--src/arch/dalvik/decomp/aput.c71
-rw-r--r--src/arch/dalvik/decomp/arithm.c253
-rw-r--r--src/arch/dalvik/decomp/array.c67
-rw-r--r--src/arch/dalvik/decomp/const.c110
-rw-r--r--src/arch/dalvik/decomp/if.c173
-rw-r--r--src/arch/dalvik/decomp/iget.c79
-rw-r--r--src/arch/dalvik/decomp/invoke.c271
-rw-r--r--src/arch/dalvik/decomp/iput.c79
-rw-r--r--src/arch/dalvik/decomp/move.c141
-rw-r--r--src/arch/dalvik/decomp/new.c73
-rw-r--r--src/arch/dalvik/decomp/ret.c84
-rw-r--r--src/arch/dalvik/decomp/switch.c62
-rw-r--r--src/arch/dalvik/decomp/translate.h101
-rw-r--r--src/arch/dalvik/instruction.c187
-rw-r--r--src/arch/dalvik/processor.c7
-rw-r--r--src/arch/instruction-int.h1
-rw-r--r--src/arch/instruction.c49
-rw-r--r--src/arch/instruction.h7
-rw-r--r--src/arch/processor-int.h4
-rw-r--r--src/arch/processor.c3
-rw-r--r--src/arch/processor.h4
-rw-r--r--src/arch/translate.h39
-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
-rw-r--r--src/format/dex/class.c17
-rw-r--r--src/format/dex/class.h3
-rw-r--r--src/format/dex/method.c3
-rw-r--r--src/format/dex/method.h2
-rw-r--r--src/format/format.c4
-rw-r--r--src/format/format.h2
108 files changed, 295 insertions, 10640 deletions
diff --git a/ChangeLog b/ChangeLog
index 34b5d87..1dede8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,124 @@
16-12-12 Cyrille Bagard <nocbos@gmail.com>
+ * configure.ac:
+ * src/Makefile.am:
+ * src/analysis/Makefile.am:
+ * src/analysis/binary.c:
+ * src/analysis/disass/disassembler.c:
+ * src/analysis/disass/output.c:
+ * src/analysis/routine.c:
+ * src/analysis/routine.h:
+ * src/analysis/type-int.h:
+ * src/analysis/type.c:
+ * src/analysis/type.h:
+ * src/analysis/types/basic.c:
+ * src/analysis/types/cse-int.h:
+ * src/analysis/types/cse.c:
+ * src/analysis/types/encaps.c:
+ * src/analysis/types/literal.c:
+ * src/analysis/types/template.c:
+ * src/analysis/variable.c:
+ * src/analysis/variable.h:
+ * src/arch/arm/context.c:
+ * src/arch/arm/context.h:
+ * src/arch/dalvik/Makefile.am:
+ * src/arch/dalvik/context.c:
+ * src/arch/dalvik/context.h:
+ Remove most of the code related to non-working decompilation.
+
+ * src/arch/dalvik/decomp/Makefile.am:
+ * src/arch/dalvik/decomp/aget.c:
+ * src/arch/dalvik/decomp/aput.c:
+ * src/arch/dalvik/decomp/arithm.c:
+ * src/arch/dalvik/decomp/array.c:
+ * src/arch/dalvik/decomp/const.c:
+ * src/arch/dalvik/decomp/if.c:
+ * src/arch/dalvik/decomp/iget.c:
+ * src/arch/dalvik/decomp/invoke.c:
+ * src/arch/dalvik/decomp/iput.c:
+ * src/arch/dalvik/decomp/move.c:
+ * src/arch/dalvik/decomp/new.c:
+ * src/arch/dalvik/decomp/ret.c:
+ * src/arch/dalvik/decomp/switch.c:
+ * src/arch/dalvik/decomp/translate.h:
+ Deleted entries.
+
+ * src/arch/dalvik/instruction.c:
+ * src/arch/dalvik/processor.c:
+ * src/arch/instruction-int.h:
+ * src/arch/instruction.c:
+ * src/arch/instruction.h:
+ * src/arch/processor-int.h:
+ * src/arch/processor.c:
+ * src/arch/processor.h:
+ Remove most of the code related to non-working decompilation.
+
+ * src/arch/translate.h:
+ * src/decomp/Makefile.am:
+ * src/decomp/context-int.h:
+ * src/decomp/context.c:
+ * src/decomp/context.h:
+ * src/decomp/expr/Makefile.am:
+ * src/decomp/expr/access.c:
+ * src/decomp/expr/access.h:
+ * src/decomp/expr/arithm.c:
+ * src/decomp/expr/arithm.h:
+ * src/decomp/expr/array.c:
+ * src/decomp/expr/array.h:
+ * src/decomp/expr/assign.c:
+ * src/decomp/expr/assign.h:
+ * src/decomp/expr/block.c:
+ * src/decomp/expr/block.h:
+ * src/decomp/expr/call.c:
+ * src/decomp/expr/call.h:
+ * src/decomp/expr/comp.c:
+ * src/decomp/expr/comp.h:
+ * src/decomp/expr/cond.c:
+ * src/decomp/expr/cond.h:
+ * src/decomp/expr/dalvik/Makefile.am:
+ * src/decomp/expr/dalvik/array.c:
+ * src/decomp/expr/dalvik/array.h:
+ * src/decomp/expr/immediate.c:
+ * src/decomp/expr/immediate.h:
+ * src/decomp/expr/pseudo.c:
+ * src/decomp/expr/pseudo.h:
+ * src/decomp/expr/return.c:
+ * src/decomp/expr/return.h:
+ * src/decomp/expr/text.c:
+ * src/decomp/expr/text.h:
+ * src/decomp/expression-int.h:
+ * src/decomp/expression.c:
+ * src/decomp/expression.h:
+ * src/decomp/instr/Makefile.am:
+ * src/decomp/instr/ite.c:
+ * src/decomp/instr/ite.h:
+ * src/decomp/instr/keyword.c:
+ * src/decomp/instr/keyword.h:
+ * src/decomp/instr/switch.c:
+ * src/decomp/instr/switch.h:
+ * src/decomp/instruction-int.h:
+ * src/decomp/instruction.c:
+ * src/decomp/instruction.h:
+ * src/decomp/lang/Makefile.am:
+ * src/decomp/lang/asm.c:
+ * src/decomp/lang/asm.h:
+ * src/decomp/lang/java.c:
+ * src/decomp/lang/java.h:
+ * src/decomp/output-int.h:
+ * src/decomp/output.c:
+ * src/decomp/output.h:
+ Deleted entries.
+
+ * src/format/dex/class.c:
+ * src/format/dex/class.h:
+ * src/format/dex/method.c:
+ * src/format/dex/method.h:
+ * src/format/format.c:
+ * src/format/format.h:
+ Remove most of the code related to non-working decompilation.
+
+16-12-12 Cyrille Bagard <nocbos@gmail.com>
+
* plugins/libcsem/exit.c:
* plugins/ropgadgets/finder.c:
* plugins/ropgadgets/finder.h:
diff --git a/configure.ac b/configure.ac
index 7d5aa74..b7166ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -351,7 +351,6 @@ AC_CONFIG_FILES([Makefile
src/arch/arm/v7/opcodes/Makefile
src/arch/arm/v7/operands/Makefile
src/arch/dalvik/Makefile
- src/arch/dalvik/decomp/Makefile
src/arch/dalvik/opdefs/Makefile
src/arch/dalvik/opcodes/Makefile
src/arch/dalvik/operands/Makefile
@@ -369,11 +368,6 @@ AC_CONFIG_FILES([Makefile
src/debug/jdwp/misc/Makefile
src/debug/jdwp/sets/Makefile
src/debug/remgdb/Makefile
- src/decomp/Makefile
- src/decomp/expr/Makefile
- src/decomp/expr/dalvik/Makefile
- src/decomp/instr/Makefile
- src/decomp/lang/Makefile
src/format/Makefile
src/format/dex/Makefile
src/format/dwarf/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 452f163..ad9f22d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,7 +34,6 @@ libchrysadisass_la_LIBADD = \
arch/libarch.la \
debug/libdebug.la \
debug/remgdb/libdebugremgdb.la \
- decomp/libdecomp.la \
format/libformat.la
@@ -123,6 +122,6 @@ csrvmng_LDFLAGS = $(LIBXML_LIBS) -Lcommon/.libs -lcommon
# glibext doit être traité en premier, à cause des marshals GLib
-SUBDIRS = core glibext gtkext analysis arch format common debug decomp gui plugins
+SUBDIRS = core glibext gtkext analysis arch format common debug gui plugins
# TODO: rm -rf panels
diff --git a/src/analysis/Makefile.am b/src/analysis/Makefile.am
index c143e1b..8b346f9 100755
--- a/src/analysis/Makefile.am
+++ b/src/analysis/Makefile.am
@@ -19,10 +19,11 @@ libanalysis_la_LIBADD = \
contents/libanalysiscontents.la \
db/libanalysisdb.la \
db/libanalysiskeys.la \
- decomp/libanalysisdecomp.la \
disass/libanalysisdisass.la \
types/libanalysistypes.la
+# decomp/libanalysisdecomp.la
+
libanalysis_la_LDFLAGS =
@@ -30,4 +31,4 @@ AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-SUBDIRS = blocks contents db decomp disass types
+SUBDIRS = blocks contents db disass types
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index 2563355..64d8fc4 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -1656,9 +1656,10 @@ void ack_completed_disassembly(GDelayedDisassembly *disass, GLoadedBinary *binar
{
binary->dec_buffers = (GCodeBuffer **)calloc(binary->decbuf_count, sizeof(GCodeBuffer *));
+ /*
for (i = 0; i < binary->decbuf_count; i++)
binary->dec_buffers[i] = decompile_all_from_file(binary, files[i]);
-
+ */
}
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index 62821ab..813701e 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -37,7 +37,6 @@
#include "instructions.h"
#include "routines.h"
-#include "../../decomp/lang/asm.h"
#include "../../format/format.h"
#include "../../glibext/delayed-int.h"
#include "../../gui/panels/log.h"
@@ -628,6 +627,7 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkStatus
static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, const char *checksum)
{
+#if 0
GLangOutput *output; /* Modèle de sortie adéquat */
GBufferLine *line; /* Ligne de destination */
bool managed; /* Groupe déjà défini ? */
@@ -714,7 +714,7 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con
}
g_object_unref(G_OBJECT(output));
-
+#endif
}
diff --git a/src/analysis/disass/output.c b/src/analysis/disass/output.c
index be4e900..f5decb7 100644
--- a/src/analysis/disass/output.c
+++ b/src/analysis/disass/output.c
@@ -29,7 +29,6 @@
#include "../../arch/processor.h"
#include "../../common/extstr.h"
-#include "../../decomp/lang/asm.h"
#include "../../format/format.h"
#include "../../gui/panels/log.h"
@@ -60,7 +59,6 @@
void print_disassembled_instructions(GCodeBuffer *buffer, GExeFormat *format, GArchProcessor *proc, GtkStatusStack *status)
{
- GLangOutput *output; /* Modèle de sortie adéquat */
GPortionLayer *layer; /* Couche première de portions */
GBinPortion **portions; /* Morceaux d'encadrement */
size_t portions_count; /* Taille de cette liste */
@@ -102,8 +100,6 @@ void print_disassembled_instructions(GCodeBuffer *buffer, GExeFormat *format, GA
- output = g_asm_output_new();
-
layer = g_exe_format_get_main_layer(format);
portions = g_portion_layer_collect_all_portions(layer, &portions_count);
@@ -339,8 +335,6 @@ void print_disassembled_instructions(GCodeBuffer *buffer, GExeFormat *format, GA
g_object_unref(G_OBJECT(layer));
- g_object_unref(G_OBJECT(output));
-
fprintf(stderr, "MISSING :: %u symbols\n", _missing);
diff --git a/src/analysis/routine.c b/src/analysis/routine.c
index a33158d..4f18b59 100644
--- a/src/analysis/routine.c
+++ b/src/analysis/routine.c
@@ -60,7 +60,7 @@ struct _GBinRoutine
GArchInstruction *instr; /* Instructions natives */
GBlockList *blocks; /* Blocs basiques d'instruct° */
- GDecInstruction *dinstr; /* Instructions décompilées */
+ //GDecInstruction *dinstr; /* Instructions décompilées */
};
@@ -893,12 +893,13 @@ void g_binary_routine_set_basic_blocks(GBinRoutine *routine, GBlockList *blocks)
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
GDecInstruction *g_binary_routine_get_decomp_instructions(const GBinRoutine *routine)
{
return routine->dinstr;
}
+#endif
/******************************************************************************
@@ -913,7 +914,7 @@ GDecInstruction *g_binary_routine_get_decomp_instructions(const GBinRoutine *rou
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
void g_binary_routine_set_decomp_instructions(GBinRoutine *routine, GDecInstruction *instr)
{
if (routine->dinstr != NULL)
@@ -922,6 +923,7 @@ void g_binary_routine_set_decomp_instructions(GBinRoutine *routine, GDecInstruct
routine->dinstr = instr;
}
+#endif
/******************************************************************************
@@ -1019,7 +1021,7 @@ char *_g_binary_routine_to_string(const GBinRoutine *routine, Routine2StringOpti
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
void g_binary_routine_output_info(const GBinRoutine *routine, GLangOutput *lang, GCodeBuffer *buffer)
{
GBufferLine *line; /* Adresse d'une ligne nouvelle*/
@@ -1065,6 +1067,7 @@ void g_binary_routine_output_info(const GBinRoutine *routine, GLangOutput *lang,
//g_lang_output_end_routine_prototype(lang, buffer, line);
}
+#endif
/******************************************************************************
@@ -1081,7 +1084,7 @@ void g_binary_routine_output_info(const GBinRoutine *routine, GLangOutput *lang,
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
void g_binary_routine_print_code(const GBinRoutine *routine, GLangOutput *lang, GCodeBuffer *buffer, bool body)
{
GBufferLine *line; /* Adresse d'une ligne nouvelle*/
@@ -1126,3 +1129,4 @@ void g_binary_routine_print_code(const GBinRoutine *routine, GLangOutput *lang,
}
}
+#endif
diff --git a/src/analysis/routine.h b/src/analysis/routine.h
index ed24d6c..48c5361 100644
--- a/src/analysis/routine.h
+++ b/src/analysis/routine.h
@@ -33,7 +33,6 @@
#include "variable.h"
#include "disass/block.h"
//#include "../arch/instruction.h"
-#include "../decomp/instruction.h"
typedef struct _GArchInstruction GArchInstruction;
@@ -170,10 +169,10 @@ GBlockList *g_binary_routine_get_basic_blocks(const GBinRoutine *);
void g_binary_routine_set_basic_blocks(GBinRoutine *, GBlockList *);
/* Fournit les instructions décompilées correspondantes. */
-GDecInstruction *g_binary_routine_get_decomp_instructions(const GBinRoutine *);
+//GDecInstruction *g_binary_routine_get_decomp_instructions(const GBinRoutine *);
/* Définit les instructions décompilées de la routine. */
-void g_binary_routine_set_decomp_instructions(GBinRoutine *, GDecInstruction *);
+//void g_binary_routine_set_decomp_instructions(GBinRoutine *, GDecInstruction *);
/* Décrit le prototype de la routine sous forme de caractères. */
char *_g_binary_routine_to_string(const GBinRoutine *, Routine2StringOptions);
@@ -181,10 +180,10 @@ char *_g_binary_routine_to_string(const GBinRoutine *, Routine2StringOptions);
#define g_binary_routine_to_string(r) _g_binary_routine_to_string((r), RSO_ALL)
/* Procède à l'impression de la description d'une routine. */
-void g_binary_routine_output_info(const GBinRoutine *, GLangOutput *, GCodeBuffer *);
+//void g_binary_routine_output_info(const GBinRoutine *, GLangOutput *, GCodeBuffer *);
/* Procède à l'impression de la décompilation d'une routine. */
-void g_binary_routine_print_code(const GBinRoutine *, GLangOutput *, GCodeBuffer *, bool);
+//void g_binary_routine_print_code(const GBinRoutine *, GLangOutput *, GCodeBuffer *, bool);
diff --git a/src/analysis/type-int.h b/src/analysis/type-int.h
index 85b05e1..489fdaf 100644
--- a/src/analysis/type-int.h
+++ b/src/analysis/type-int.h
@@ -36,7 +36,7 @@ typedef GDataType * (* type_dup_fc) (const GDataType *);
typedef char * (* type_to_string_fc) (const GDataType *);
/* Procède à l'impression de la description d'un type. */
-typedef void (* output_type_fc) (const GDataType *, GLangOutput *, GBufferLine *, bool, bool);
+//typedef void (* output_type_fc) (const GDataType *, GLangOutput *, GBufferLine *, bool, bool);
/* Description de type quelconque (instance) */
@@ -46,7 +46,7 @@ struct _GDataType
type_dup_fc dup; /* Copie d'instance existante */
type_to_string_fc to_string; /* Conversion au format texte */
- output_type_fc output; /* Impression à l'écran */
+ //output_type_fc output; /* Impression à l'écran */
GDataType *namespace; /* Espace de noms / classe */
TypeQualifier qualifiers; /* Eventuels qualificatifs */
diff --git a/src/analysis/type.c b/src/analysis/type.c
index 53d3636..35a3f78 100644
--- a/src/analysis/type.c
+++ b/src/analysis/type.c
@@ -220,12 +220,13 @@ char *_g_data_type_to_string(const GDataType *type, bool simple)
* Remarques : - *
* *
******************************************************************************/
-
+/*
void g_data_type_output(const GDataType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
{
type->output(type, lang, line, info, full);
}
+*/
/******************************************************************************
diff --git a/src/analysis/type.h b/src/analysis/type.h
index f7fba36..9e11f41 100644
--- a/src/analysis/type.h
+++ b/src/analysis/type.h
@@ -31,7 +31,6 @@
#include "../arch/archbase.h"
-#include "../decomp/output.h"
#include "../glibext/gbufferline.h"
@@ -86,7 +85,7 @@ void g_data_type_add_qualifier(GDataType *, TypeQualifier);
bool g_data_type_is_pointer(const GDataType *, bool);
/* Procède à l'impression de la description d'un type. */
-void g_data_type_output(const GDataType *, GLangOutput *, GBufferLine *, bool, bool);
+//void g_data_type_output(const GDataType *, GLangOutput *, GBufferLine *, bool, bool);
diff --git a/src/analysis/types/basic.c b/src/analysis/types/basic.c
index 7278908..6a52fed 100644
--- a/src/analysis/types/basic.c
+++ b/src/analysis/types/basic.c
@@ -62,7 +62,7 @@ static GDataType *g_basic_type_dup(const GBasicType *);
static char *g_basic_type_to_string(const GBasicType *);
/* Procède à l'impression de la description d'un type. */
-static void g_basic_type_output(const GBasicType *, GLangOutput *, GBufferLine *, bool, bool);
+//static void g_basic_type_output(const GBasicType *, GLangOutput *, GBufferLine *, bool, bool);
@@ -108,7 +108,7 @@ static void g_basic_type_init(GBasicType *type)
data_type->dup = (type_dup_fc)g_basic_type_dup;
data_type->to_string = (type_to_string_fc)g_basic_type_to_string;
- data_type->output = (output_type_fc)g_basic_type_output;
+ //data_type->output = (output_type_fc)g_basic_type_output;
}
@@ -310,7 +310,7 @@ static char *g_basic_type_to_string(const GBasicType *type)
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
static void g_basic_type_output(const GBasicType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
{
char *text; /* Version humaine à imprimer */
@@ -324,6 +324,7 @@ static void g_basic_type_output(const GBasicType *type, GLangOutput *lang, GBuff
free(text);
}
+#endif
/******************************************************************************
diff --git a/src/analysis/types/cse-int.h b/src/analysis/types/cse-int.h
index 9486adc..f2c9a0b 100644
--- a/src/analysis/types/cse-int.h
+++ b/src/analysis/types/cse-int.h
@@ -52,7 +52,7 @@ struct _GClassEnumTypeClass
char *g_class_enum_type_to_string(const GClassEnumType *);
/* Procède à l'impression de la description d'un type. */
-void g_class_enum_type_output(const GClassEnumType *, GLangOutput *, GBufferLine *, bool, bool);
+//void g_class_enum_type_output(const GClassEnumType *, GLangOutput *, GBufferLine *, bool, bool);
diff --git a/src/analysis/types/cse.c b/src/analysis/types/cse.c
index bd57244..dca83ec 100644
--- a/src/analysis/types/cse.c
+++ b/src/analysis/types/cse.c
@@ -84,7 +84,7 @@ static void g_class_enum_type_init(GClassEnumType *type)
data_type->dup = (type_dup_fc)g_class_enum_type_dup;
data_type->to_string = (type_to_string_fc)g_class_enum_type_to_string;
- data_type->output = (output_type_fc)g_class_enum_type_output;
+ //data_type->output = (output_type_fc)g_class_enum_type_output;
}
@@ -169,10 +169,11 @@ char *g_class_enum_type_to_string(const GClassEnumType *type)
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
void g_class_enum_type_output(const GClassEnumType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
{
g_buffer_line_append_text(line, BLC_LAST_USED, type->name, strlen(type->name),
info ? RTT_COMMENT : RTT_RAW, NULL);
}
+#endif
diff --git a/src/analysis/types/encaps.c b/src/analysis/types/encaps.c
index 17402d5..37932f8 100644
--- a/src/analysis/types/encaps.c
+++ b/src/analysis/types/encaps.c
@@ -62,7 +62,7 @@ static GDataType *g_encapsulated_type_dup(const GEncapsulatedType *);
static char *g_encapsulated_type_to_string(const GEncapsulatedType *);
/* Procède à l'impression de la description d'un type. */
-static void g_encapsulated_type_output(const GEncapsulatedType *, GLangOutput *, GBufferLine *, bool, bool);
+//static void g_encapsulated_type_output(const GEncapsulatedType *, GLangOutput *, GBufferLine *, bool, bool);
@@ -108,7 +108,7 @@ static void g_encapsulated_type_init(GEncapsulatedType *type)
data_type->dup = (type_dup_fc)g_encapsulated_type_dup;
data_type->to_string = (type_to_string_fc)g_encapsulated_type_to_string;
- data_type->output = (output_type_fc)g_encapsulated_type_output;
+ //data_type->output = (output_type_fc)g_encapsulated_type_output;
}
@@ -273,12 +273,13 @@ static char *g_encapsulated_type_to_string(const GEncapsulatedType *type)
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
static void g_encapsulated_type_output(const GEncapsulatedType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
{
g_buffer_line_append_text(line, BLC_LAST_USED, "!TODO!", 6, info ? RTT_COMMENT : RTT_RAW, NULL);
}
+#endif
/******************************************************************************
diff --git a/src/analysis/types/literal.c b/src/analysis/types/literal.c
index d4b7edf..bf184e0 100644
--- a/src/analysis/types/literal.c
+++ b/src/analysis/types/literal.c
@@ -65,7 +65,7 @@ static GDataType *g_literal_type_dup(const GLiteralType *);
static char *g_literal_type_to_string(const GLiteralType *);
/* Procède à l'impression de la description d'un type. */
-static void g_literal_type_output(const GLiteralType *, GLangOutput *, GBufferLine *, bool, bool);
+//static void g_literal_type_output(const GLiteralType *, GLangOutput *, GBufferLine *, bool, bool);
@@ -111,7 +111,7 @@ static void g_literal_type_init(GLiteralType *type)
data_type->dup = (type_dup_fc)g_literal_type_dup;
data_type->to_string = (type_to_string_fc)g_literal_type_to_string;
- data_type->output = (output_type_fc)g_literal_type_output;
+ //data_type->output = (output_type_fc)g_literal_type_output;
}
@@ -225,7 +225,7 @@ static char *g_literal_type_to_string(const GLiteralType *type)
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
static void g_literal_type_output(const GLiteralType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
{
char *text; /* Version humaine à imprimer */
@@ -239,3 +239,4 @@ static void g_literal_type_output(const GLiteralType *type, GLangOutput *lang, G
free(text);
}
+#endif
diff --git a/src/analysis/types/template.c b/src/analysis/types/template.c
index 42a9ebe..f24eaaa 100644
--- a/src/analysis/types/template.c
+++ b/src/analysis/types/template.c
@@ -65,7 +65,7 @@ static GDataType *g_template_type_dup(const GTemplateType *);
static char *g_template_type_to_string(const GTemplateType *);
/* Procède à l'impression de la description d'un type. */
-static void g_template_type_output(const GTemplateType *, GLangOutput *, GBufferLine *, bool, bool);
+//static void g_template_type_output(const GTemplateType *, GLangOutput *, GBufferLine *, bool, bool);
@@ -112,7 +112,7 @@ static void g_template_type_init(GTemplateType *type)
data_type->dup = (type_dup_fc)g_template_type_dup;
data_type->to_string = (type_to_string_fc)g_template_type_to_string;
- data_type->output = (output_type_fc)g_template_type_output;
+ //data_type->output = (output_type_fc)g_template_type_output;
ce_type = G_CLASS_ENUM_TYPE(type);
@@ -233,7 +233,7 @@ static char *g_template_type_to_string(const GTemplateType *type)
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
static void g_template_type_output(const GTemplateType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
{
size_t i; /* Boucle de parcours */
@@ -254,6 +254,7 @@ static void g_template_type_output(const GTemplateType *type, GLangOutput *lang,
g_buffer_line_append_text(line, BLC_LAST_USED, ">", 1, info ? RTT_COMMENT : RTT_LTGT, NULL);
}
+#endif
/******************************************************************************
diff --git a/src/analysis/variable.c b/src/analysis/variable.c
index b390658..02596f6 100644
--- a/src/analysis/variable.c
+++ b/src/analysis/variable.c
@@ -287,7 +287,7 @@ char *g_binary_variable_to_string(const GBinVariable *var, bool simple)
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
void g_binary_variable_output(const GBinVariable *var, GLangOutput *lang, GBufferLine *line, bool info, bool full)
{
g_data_type_output(var->type, lang, line, info, full);
@@ -302,7 +302,7 @@ void g_binary_variable_output(const GBinVariable *var, GLangOutput *lang, GBuffe
}
}
-
+#endif
diff --git a/src/analysis/variable.h b/src/analysis/variable.h
index 162c0e6..00c5e3a 100644
--- a/src/analysis/variable.h
+++ b/src/analysis/variable.h
@@ -77,7 +77,7 @@ void g_binary_variable_set_owner(GBinVariable *, GDataType *);
char *g_binary_variable_to_string(const GBinVariable *, bool);
/* Procède à l'impression de la description d'une variable. */
-void g_binary_variable_output(const GBinVariable *, GLangOutput *, GBufferLine *, bool, bool);
+//void g_binary_variable_output(const GBinVariable *, GLangOutput *, GBufferLine *, bool, bool);
diff --git a/src/arch/arm/context.c b/src/arch/arm/context.c
index b952027..e72e6df 100644
--- a/src/arch/arm/context.c
+++ b/src/arch/arm/context.c
@@ -30,7 +30,6 @@
#include "context-int.h"
-#include "../../decomp/context-int.h"
@@ -56,7 +55,7 @@ static size_t find_disass_arm_area(disass_arm_area *, virt_t, size_t, size_t);
/* ------------------------- CONTEXTE POUR LA DECOMPILATION ------------------------- */
-
+#if 0
/* Définition d'un contexte pour décompilation ARM (instance) */
struct _GArmDContext
{
@@ -89,6 +88,7 @@ static void g_arm_dcontext_dispose(GArmDContext *);
/* Procède à la libération totale de la mémoire. */
static void g_arm_dcontext_finalize(GArmDContext *);
+#endif
@@ -338,7 +338,7 @@ unsigned int _g_arm_context_find_encoding(GArmContext *ctx, virt_t addr)
/* CONTEXTE POUR LA DECOMPILATION */
/* ---------------------------------------------------------------------------------- */
-
+#if 0
/* Indique le type définit par la GLib pour le contexte de décompilation ARM. */
G_DEFINE_TYPE(GArmDContext, g_arm_dcontext, G_TYPE_DEC_CONTEXT);
@@ -444,3 +444,4 @@ GArmDContext *g_arm_dcontext_new(void)
return result;
}
+#endif
diff --git a/src/arch/arm/context.h b/src/arch/arm/context.h
index 304b5e0..ccc2d88 100644
--- a/src/arch/arm/context.h
+++ b/src/arch/arm/context.h
@@ -57,7 +57,7 @@ GArmContext *g_arm_context_new(void);
/* ------------------------- CONTEXTE POUR LA DECOMPILATION ------------------------- */
-
+#if 0
#define G_TYPE_ARM_DCONTEXT g_arm_dcontext_get_type()
#define G_ARM_DCONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_arm_dcontext_get_type(), GArmDContext))
#define G_IS_ARM_DCONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_arm_dcontext_get_type()))
@@ -78,6 +78,7 @@ GType g_arm_dcontext_get_type(void);
/* Crée un contexte pour la décompilation ARM. */
GArmDContext *g_arm_dcontext_new(void);
+#endif
diff --git a/src/arch/dalvik/Makefile.am b/src/arch/dalvik/Makefile.am
index b97e7d8..d994242 100644
--- a/src/arch/dalvik/Makefile.am
+++ b/src/arch/dalvik/Makefile.am
@@ -16,7 +16,6 @@ libarchdalvik_la_SOURCES = \
register.h register.c
libarchdalvik_la_LIBADD = \
- decomp/libarchdalvikdecomp.la \
opcodes/libarchdalvikopcodes.la \
operands/libarchdalvikoperands.la \
pseudo/libarchdalvikpseudo.la
@@ -29,4 +28,4 @@ AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-SUBDIRS = decomp opdefs opcodes operands pseudo
+SUBDIRS = opdefs opcodes operands pseudo
diff --git a/src/arch/dalvik/context.c b/src/arch/dalvik/context.c
index b293d08..3b79ffa 100644
--- a/src/arch/dalvik/context.c
+++ b/src/arch/dalvik/context.c
@@ -34,8 +34,6 @@
#include "../raw.h"
#include "../../analysis/contents/restricted.h"
#include "../../common/sort.h"
-#include "../../decomp/context-int.h"
-#include "../../decomp/expr/pseudo.h"
#include "../../format/dex/dex-int.h"
@@ -89,6 +87,7 @@ static void g_dalvik_context_finalize(GDalvikContext *);
/* ------------------------- CONTEXTE POUR LA DECOMPILATION ------------------------- */
+#if 0
/* Définition d'un contexte pour décompilation Dalkvik (instance) */
struct _GDalvikDContext
{
@@ -130,6 +129,7 @@ static void g_dalvik_context_spread_allocated_shared_reg(GDalvikDContext *, GDal
/* Convertit un registre machine en un pseudo-registre. */
static GDecInstruction *g_dalvik_dcontext_convert_register(GDalvikDContext *, GDalvikRegisterOperand *, bool, vmpa_t);
+#endif
@@ -423,6 +423,7 @@ GArchInstruction *g_dalvik_context_get_raw_data(GDalvikContext *ctx, const GBinC
/* ---------------------------------------------------------------------------------- */
+#if 0
/* Indique le type définit par la GLib pour le contexte de décompilation Dalkvik. */
G_DEFINE_TYPE(GDalvikDContext, g_dalvik_dcontext, G_TYPE_DEC_CONTEXT);
@@ -739,3 +740,4 @@ static GDecInstruction *g_dalvik_dcontext_convert_register(GDalvikDContext *ctx,
return result;
}
+#endif
diff --git a/src/arch/dalvik/context.h b/src/arch/dalvik/context.h
index 42399b5..7449219 100644
--- a/src/arch/dalvik/context.h
+++ b/src/arch/dalvik/context.h
@@ -31,7 +31,6 @@
#include "instruction.h"
#include "../archbase.h"
-#include "../../decomp/context.h"
@@ -73,6 +72,7 @@ GArchInstruction *g_dalvik_context_get_raw_data(GDalvikContext *, const GBinCont
/* ------------------------- CONTEXTE POUR LA DECOMPILATION ------------------------- */
+#if 0
#define G_TYPE_DALVIK_DCONTEXT g_dalvik_dcontext_get_type()
#define G_DALVIK_DCONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_dalvik_dcontext_get_type(), GDalvikDContext))
#define G_IS_DALVIK_DCONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_dalvik_dcontext_get_type()))
@@ -93,6 +93,7 @@ GType g_dalvik_dcontext_get_type(void);
/* Crée un contexte pour la décompilation Dalvik. */
GDalvikDContext *g_dalvik_dcontext_new(void);
+#endif
diff --git a/src/arch/dalvik/decomp/Makefile.am b/src/arch/dalvik/decomp/Makefile.am
deleted file mode 100644
index 053bf4c..0000000
--- a/src/arch/dalvik/decomp/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-
-noinst_LTLIBRARIES = libarchdalvikdecomp.la
-
-libarchdalvikdecomp_la_SOURCES = \
- aget.c \
- aput.c \
- arithm.c \
- array.c \
- const.c \
- if.c \
- iget.c \
- invoke.c \
- iput.c \
- move.c \
- new.c \
- ret.c \
- switch.c \
- translate.h
-
-libarchdalvikdecomp_la_LIBADD =
-
-libarchdalvikdecomp_la_CFLAGS = $(AM_CFLAGS)
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
diff --git a/src/arch/dalvik/decomp/aget.c b/src/arch/dalvik/decomp/aget.c
deleted file mode 100644
index 19d62a8..0000000
--- a/src/arch/dalvik/decomp/aget.c
+++ /dev/null
@@ -1,71 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * aget.c - décompilation des instructions manipulant des tableaux (chargement)
- *
- * 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 "translate.h"
-
-
-#include "../../../decomp/expr/array.h"
-#include "../../../decomp/expr/assign.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'aget'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_aget(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *array; /* Tableau accédé */
- GDecInstruction *index; /* Indice de cellule considérée*/
- GDecInstruction *content; /* Contenu de cellule visé */
- GDecInstruction *access; /* Représentation de l'accès */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- array = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 2);
- index = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- content = g_dec_context_convert_register(ctx, operand, true, addr);
-
- access = g_array_access_new(G_DEC_EXPRESSION(array), G_DEC_EXPRESSION(index));
- result = g_assign_expression_new(G_DEC_EXPRESSION(content), G_DEC_EXPRESSION(access));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/aput.c b/src/arch/dalvik/decomp/aput.c
deleted file mode 100644
index b62736e..0000000
--- a/src/arch/dalvik/decomp/aput.c
+++ /dev/null
@@ -1,71 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * aput.c - décompilation des instructions manipulant des tableaux (enregistrement)
- *
- * 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 "translate.h"
-
-
-#include "../../../decomp/expr/array.h"
-#include "../../../decomp/expr/assign.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'aput'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_aput(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *content; /* Contenu de cellule visé */
- GDecInstruction *array; /* Tableau accédé */
- GDecInstruction *index; /* Indice de cellule considérée*/
- GDecInstruction *access; /* Représentation de l'accès */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- content = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- array = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 2);
- index = g_dec_context_convert_register(ctx, operand, false, addr);
-
- access = g_array_access_new(G_DEC_EXPRESSION(array), G_DEC_EXPRESSION(index));
- result = g_assign_expression_new(G_DEC_EXPRESSION(access), G_DEC_EXPRESSION(content));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/arithm.c b/src/arch/dalvik/decomp/arithm.c
deleted file mode 100644
index 32e105e..0000000
--- a/src/arch/dalvik/decomp/arithm.c
+++ /dev/null
@@ -1,253 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * arithm.c - décompilation 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 "translate.h"
-
-
-#include "../instruction.h"
-#include "../../../decomp/expr/arithm.h"
-#include "../../../decomp/expr/assign.h"
-#include "../../../decomp/expr/immediate.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'opérations arithmétiques'.*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_arithm(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- ArithmOperationType type; /* Type d'opération menée */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *op1; /* Premier opérande utilisé */
- GDecInstruction *op2; /* Second opérande utilisé */
- GDecInstruction *dest; /* Enregistrement du résultat */
- GDecInstruction *arithm; /* Opération arithmétique */
-
- switch (g_dalvik_instruction_get_opcode(G_DALVIK_INSTRUCTION(instr)))
- {
- case DOP_ADD_INT:
- type = AOT_ADD;
- break;
- case DOP_SUB_INT:
- type = AOT_SUB;
- break;
- case DOP_MUL_INT:
- type = AOT_MUL;
- break;
- case DOP_DIV_INT:
- type = AOT_DIV;
- break;
- case DOP_REM_INT:
- type = AOT_REM;
- break;
- case DOP_AND_INT:
- type = AOT_AND;
- break;
- case DOP_OR_INT:
- type = AOT_OR;
- break;
- case DOP_XOR_INT:
- type = AOT_XOR;
- break;
- default:
- type = AOT_COUNT;
- break;
- }
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- op1 = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 2);
- op2 = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- arithm = g_arithm_expression_new(G_DEC_EXPRESSION(op1), type, G_DEC_EXPRESSION(op2));
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(arithm));
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'opérations arithmétiques'.*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_arithm_2addr(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- ArithmOperationType type; /* Type d'opération menée */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *op1; /* Premier opérande utilisé */
- GDecInstruction *op2; /* Second opérande utilisé */
- GDecInstruction *dest; /* Enregistrement du résultat */
- GDecInstruction *arithm; /* Opération arithmétique */
-
- switch (g_dalvik_instruction_get_opcode(G_DALVIK_INSTRUCTION(instr)))
- {
- case DOP_ADD_INT_2ADDR:
- type = AOT_ADD;
- break;
- case DOP_MUL_INT_2ADDR:
- case DOP_MUL_DOUBLE_2ADDR:
- type = AOT_MUL;
- break;
- case DOP_DIV_INT_2ADDR:
- type = AOT_DIV;
- break;
- case DOP_REM_INT_2ADDR:
- type = AOT_REM;
- break;
- case DOP_AND_INT_2ADDR:
- type = AOT_AND;
- break;
- case DOP_OR_INT_2ADDR:
- type = AOT_OR;
- break;
- case DOP_XOR_INT_2ADDR:
- type = AOT_XOR;
- break;
- default:
- type = AOT_COUNT;
- break;
- }
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- op2 = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- op1 = g_dec_context_convert_register(ctx, operand, false, addr);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- arithm = g_arithm_expression_new(G_DEC_EXPRESSION(op1), type, G_DEC_EXPRESSION(op2));
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(arithm));
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'opérations arithmétiques'.*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_arithm_lit(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- ArithmOperationType type; /* Type d'opération menée */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *op1; /* Premier opérande utilisé */
- GDecInstruction *op2; /* Second opérande utilisé */
- GDecInstruction *dest; /* Enregistrement du résultat */
- GDecInstruction *arithm; /* Opération arithmétique */
-
- switch (g_dalvik_instruction_get_opcode(G_DALVIK_INSTRUCTION(instr)))
- {
- case DOP_ADD_INT_LIT8:
- case DOP_ADD_INT_LIT16:
- type = AOT_ADD;
- break;
- case DOP_MUL_INT_LIT8:
- case DOP_MUL_INT_LIT16:
- type = AOT_MUL;
- break;
- case DOP_DIV_INT_LIT8:
- case DOP_DIV_INT_LIT16:
- type = AOT_DIV;
- break;
- case DOP_REM_INT_LIT8:
- case DOP_REM_INT_LIT16:
- type = AOT_REM;
- break;
- case DOP_AND_INT_LIT8:
- case DOP_AND_INT_LIT16:
- type = AOT_AND;
- break;
- case DOP_OR_INT_LIT8:
- case DOP_OR_INT_LIT16:
- type = AOT_OR;
- break;
- case DOP_XOR_INT_LIT8:
- case DOP_XOR_INT_LIT16:
- type = AOT_XOR;
- break;
- default:
- type = AOT_COUNT;
- break;
- }
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- op1 = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 2);
- op2 = g_imm_expression_new(G_IMM_OPERAND(operand));
-
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- arithm = g_arithm_expression_new(G_DEC_EXPRESSION(op1), type, G_DEC_EXPRESSION(op2));
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(arithm));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/array.c b/src/arch/dalvik/decomp/array.c
deleted file mode 100644
index 2cb9808..0000000
--- a/src/arch/dalvik/decomp/array.c
+++ /dev/null
@@ -1,67 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * array.c - décompilation de l'opération récupérant la longueur d'un tableau
- *
- * 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 "translate.h"
-
-
-#include "../../../decomp/expr/assign.h"
-#include "../../../decomp/expr/dalvik/array.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'array-length'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_array_length(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *reg; /* Pseudo-registre redéfini */
- GDecInstruction *len; /* Enregistrement de taille */
- GDecInstruction *dest; /* Destination de la création */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- reg = g_dec_context_convert_register(ctx, operand, false, addr);
- len = g_dalvik_alength_new(G_DEC_EXPRESSION(reg));
-
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(len));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/const.c b/src/arch/dalvik/decomp/const.c
deleted file mode 100644
index 29cd29d..0000000
--- a/src/arch/dalvik/decomp/const.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * const.c - décompilation des chargements de constantes
- *
- * 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 "translate.h"
-
-
-#include "../operands/pool.h"
-#include "../../../decomp/expr/assign.h"
-#include "../../../decomp/expr/immediate.h"
-#include "../../../decomp/expr/text.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'const'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_const(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *reg; /* Pseudo-registre redéfini */
- GDecInstruction *imm; /* Valeur immédiate décompilée */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- reg = g_dec_context_convert_register(ctx, operand, true, addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- imm = g_imm_expression_new(G_IMM_OPERAND(operand));
-
- result = g_assign_expression_new(G_DEC_EXPRESSION(reg), G_DEC_EXPRESSION(imm));
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'const-string'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_const_str(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *reg; /* Pseudo-registre redéfini */
- uint32_t index; /* Indice de la chaîne */
- const char *value; /* Chaîne de caractères */
- GDecInstruction *str; /* Chaîne décompilée */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- reg = g_dec_context_convert_register(ctx, operand, true, addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- index = g_dalvik_pool_operand_get_index(G_DALVIK_POOL_OPERAND(operand));
-
- value = get_string_from_dex_pool(G_DEX_FORMAT(g_dec_context_get_format(ctx)), index);
- if (value == NULL) return NULL;
-
- str = g_str_expression_new(value);
-
- result = g_assign_expression_new(G_DEC_EXPRESSION(reg), G_DEC_EXPRESSION(str));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/if.c b/src/arch/dalvik/decomp/if.c
deleted file mode 100644
index 7e17b8d..0000000
--- a/src/arch/dalvik/decomp/if.c
+++ /dev/null
@@ -1,173 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * if.c - décompilation 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 "translate.h"
-
-
-#include "../instruction.h"
-#include "../../../decomp/expr/comp.h"
-#include "../../../decomp/expr/cond.h"
-#include "../../../decomp/expr/immediate.h"
-#include "../../../decomp/instr/ite.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de branchement conditionnel. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_if(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- CompSignType sign; /* Type d'opération menée */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *op1; /* Premier opérande utilisé */
- GDecInstruction *op2; /* Second opérande utilisé */
- vmpa_t jmp; /* Adresse de saut */
- GDecInstruction *comp; /* Comparaison à restituer */
- GDecInstruction *cond; /* Transformation en condition */
-
- switch (g_dalvik_instruction_get_opcode(G_DALVIK_INSTRUCTION(instr)))
- {
- case DOP_IF_EQ:
- sign = CST_EQ;
- break;
- case DOP_IF_NE:
- sign = CST_NE;
- break;
- case DOP_IF_LT:
- sign = CST_LT;
- break;
- case DOP_IF_GE:
- sign = CST_GE;
- break;
- case DOP_IF_GT:
- sign = CST_GT;
- break;
- case DOP_IF_LE:
- sign = CST_LE;
- break;
- default:
- sign = CST_COUNT;
- break;
- }
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- op1 = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- op2 = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 2);
- jmp = 0x1234ull;/*g_dec_context_convert_register(ctx, operand, addr);*/
-
- comp = g_comp_expression_new(G_DEC_EXPRESSION(op1), sign, G_DEC_EXPRESSION(op2));
- cond = g_cond_expression_new(comp);
- result = g_ite_instruction_new(cond, jmp, jmp);
-
- return result;
-
-}
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de branchement conditionnel. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_if_zero(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- CompSignType sign; /* Type d'opération menée */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *op1; /* Premier opérande utilisé */
- GDecInstruction *op2; /* Second opérande utilisé */
- vmpa_t jmp; /* Adresse de saut */
- GDecInstruction *comp; /* Comparaison à restituer */
- GDecInstruction *cond; /* Transformation en condition */
-
- switch (g_dalvik_instruction_get_opcode(G_DALVIK_INSTRUCTION(instr)))
- {
- case DOP_IF_EQZ:
- sign = CST_EQ;
- break;
- case DOP_IF_NEZ:
- sign = CST_NE;
- break;
- case DOP_IF_LTZ:
- sign = CST_LT;
- break;
- case DOP_IF_GEZ:
- sign = CST_GE;
- break;
- case DOP_IF_GTZ:
- sign = CST_GT;
- break;
- case DOP_IF_LEZ:
- sign = CST_LE;
- break;
- default:
- sign = CST_COUNT;
- break;
- }
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- op1 = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, (unsigned int)0);
- op2 = g_imm_expression_new(G_IMM_OPERAND(operand));
-
- operand = g_arch_instruction_get_operand(instr, 2);
- jmp = 0x1234ull;/*g_dec_context_convert_register(ctx, operand, addr);*/
-
- comp = g_comp_expression_new(G_DEC_EXPRESSION(op1), sign, G_DEC_EXPRESSION(op2));
- cond = g_cond_expression_new(comp);
- result = g_ite_instruction_new(cond, jmp, jmp);
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/iget.c b/src/arch/dalvik/decomp/iget.c
deleted file mode 100644
index 3fbaa7c..0000000
--- a/src/arch/dalvik/decomp/iget.c
+++ /dev/null
@@ -1,79 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * iget.c - décompilation des instructions manipulant des champs d'instance (chargement)
- *
- * 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 "translate.h"
-
-
-#include "../../../arch/dalvik/operands/pool.h"
-#include "../../../decomp/expr/access.h"
-#include "../../../decomp/expr/assign.h"
-#include "../../../decomp/expr/pseudo.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'iget'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_iget(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *src; /* Registre de l'object */
- uint32_t index; /* Indice dans la table */
- GDecInstruction *field; /* Champ concerné par l'opérat°*/
- GBinVariable *var; /* Variable / champ accédé */
- GDecInstruction *dest; /* Registre de destination */
- GDecInstruction *access; /* Représentation de l'accès */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- src = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 2);
- index = g_dalvik_pool_operand_get_index(G_DALVIK_POOL_OPERAND(operand));
- var = get_field_from_dex_pool(G_DEX_FORMAT(g_dec_context_get_format(ctx)), index);
-
- field = g_pseudo_register_new(PRU_FIXED);
- g_pseudo_register_set_variable(G_PSEUDO_REGISTER(field), var);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- access = g_access_expression_new(G_DEC_EXPRESSION(src), G_DEC_EXPRESSION(field));
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(access));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/invoke.c b/src/arch/dalvik/decomp/invoke.c
deleted file mode 100644
index e747ac2..0000000
--- a/src/arch/dalvik/decomp/invoke.c
+++ /dev/null
@@ -1,271 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * invoke.c - décompilation des appels de méthode
- *
- * 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 "translate.h"
-
-
-#include <string.h>
-
-
-#include "../instruction.h"
-#include "../operand.h"
-#include "../../../decomp/expr/access.h"
-#include "../../../decomp/expr/assign.h"
-#include "../../../decomp/expr/call.h"
-#include "../../../format/dex/pool.h"
-
-
-#define get_routine_from_dex_pool(p, i) NULL
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'invoke-direct'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_invoke_direct(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- GDecInstruction *iter; /* Boucle de parcours #1 */
- GDecInstruction *list; /* Instructions décompilées */
- size_t count; /* Quantité d'opérandes */
- GArchOperand *operand; /* Opérande de l'instruction */
- uint32_t index; /* Indice de l'élément visé */
- GBinRoutine *routine; /* Routine visée par l'appel */
- const char *name; /* Chaîne à afficher */
- GDecInstruction *src; /* Source de l'assignation */
- GDecInstruction *dest; /* Destination de l'assignat° */
- vmpa_t addr; /* Adresse de l'instruction */
- size_t i; /* Boucle de parcours #2 */
- GArchOperand *arg; /* Argument brut de l'appel */
- GDecInstruction *reg; /* Argument converti */
-
- result = NULL;
- iter = NULL;
-
- list = g_dec_context_get_decomp_instrs(ctx);
- if (list == NULL) return NULL;
-
- /* Récupération de la méthode */
-
- count = g_arch_instruction_count_operands(instr);
- operand = g_arch_instruction_get_operand(instr, count - 1);
-
- index = g_dalvik_pool_operand_get_index(G_DALVIK_POOL_OPERAND(operand));
-
- routine = get_routine_from_dex_pool(G_DEX_FORMAT(g_dec_context_get_format(ctx)), index);
- if (routine == NULL) return NULL;
-
- /* Détermination de la routine-cible exacte */
-
- name = g_binary_routine_get_name(routine);
-
- if (strcmp(name, "<init>") != 0)
- result = g_routine_call_new(routine);
-
- else
- {
- src = NULL; /* Pour gcc... */
-
- for (iter = g_dec_instruction_get_last(list);
- iter != NULL;
- iter = g_dec_instruction_get_prev_iter(list, iter))
- {
- if (!G_IS_ASSIGN_EXPRESSION(iter)) continue;
-
- src = g_assign_expression_get_src(G_ASSIGN_EXPRESSION(iter));
- if (!G_IS_ROUTINE_CALL(src)) continue;
-
- dest = g_assign_expression_get_dest(G_ASSIGN_EXPRESSION(iter));
- /* TODO : vérifier aussi la concordance des registres src && instr */
-
- break;
-
- }
-
- if (iter == NULL) return NULL;
-
- result = src;
-
- g_dec_instruction_delete(&list, iter);
- g_dec_context_set_decomp_instrs(ctx, list);
-
- }
-
- /* Ajout des arguments */
-
- operand = g_arch_instruction_get_operand(instr, 0);
- count = g_dalvik_args_count(G_DALVIK_ARGS_OPERAND(operand));
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- for (i = 1; i < count; i++)
- {
- arg = g_dalvik_args_operand_get(G_DALVIK_ARGS_OPERAND(operand), i);
- reg = g_dec_context_convert_register(ctx, arg, false, addr);
-
- g_routine_call_add_arg(G_ROUTINE_CALL(result), reg);
-
- }
-
- return (iter != NULL ? iter : result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'invoke-static'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_invoke_static(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- size_t count; /* Quantité d'opérandes */
- GArchOperand *operand; /* Opérande de l'instruction */
- uint32_t index; /* Indice de l'élément visé */
- GBinRoutine *routine; /* Routine visée par l'appel */
- GDecInstruction *call; /* Représentation de l'appel */
- vmpa_t addr; /* Adresse de l'instruction */
- size_t i; /* Boucle de parcours #2 */
- GArchOperand *arg; /* Argument brut de l'appel */
- GDecInstruction *reg; /* Argument converti */
-
- result = NULL;
-
- /* Récupération de la méthode */
-
- count = g_arch_instruction_count_operands(instr);
- operand = g_arch_instruction_get_operand(instr, count - 1);
-
- index = g_dalvik_pool_operand_get_index(G_DALVIK_POOL_OPERAND(operand));
-
- routine = get_routine_from_dex_pool(G_DEX_FORMAT(g_dec_context_get_format(ctx)), index);
- if (routine == NULL) return NULL;
-
- call = g_routine_call_new(routine);
-
- /* Ajout des arguments */
-
- operand = g_arch_instruction_get_operand(instr, 0);
- count = g_dalvik_args_count(G_DALVIK_ARGS_OPERAND(operand));
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- for (i = 0; i < count; i++)
- {
- arg = g_dalvik_args_operand_get(G_DALVIK_ARGS_OPERAND(operand), i);
- reg = g_dec_context_convert_register(ctx, arg, false, addr);
-
- g_routine_call_add_arg(G_ROUTINE_CALL(call), reg);
-
- }
-
- return call;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'invoke-virtual'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_invoke_virtual(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- size_t count; /* Quantité d'opérandes */
- GArchOperand *operand; /* Opérande de l'instruction */
- uint32_t index; /* Indice de l'élément visé */
- GBinRoutine *routine; /* Routine visée par l'appel */
- GDecInstruction *call; /* Représentation de l'appel */
- vmpa_t addr; /* Adresse de l'instruction */
- size_t i; /* Boucle de parcours #2 */
- GArchOperand *arg; /* Argument brut de l'appel */
- GDecInstruction *reg; /* Argument converti */
-
- result = NULL;
-
- /* Récupération de la méthode */
-
- count = g_arch_instruction_count_operands(instr);
- operand = g_arch_instruction_get_operand(instr, count - 1);
-
- index = g_dalvik_pool_operand_get_index(G_DALVIK_POOL_OPERAND(operand));
-
- routine = get_routine_from_dex_pool(G_DEX_FORMAT(g_dec_context_get_format(ctx)), index);
- if (routine == NULL) return NULL;
-
- call = g_routine_call_new(routine);
-
- /* Ajout des arguments */
-
- operand = g_arch_instruction_get_operand(instr, 0);
- count = g_dalvik_args_count(G_DALVIK_ARGS_OPERAND(operand));
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- for (i = 1; i < count; i++)
- {
- arg = g_dalvik_args_operand_get(G_DALVIK_ARGS_OPERAND(operand), i);
- reg = g_dec_context_convert_register(ctx, arg, false, addr);
-
- g_routine_call_add_arg(G_ROUTINE_CALL(call), reg);
-
- }
-
- /* Appel depuis le propriétaire */
-
- arg = g_dalvik_args_operand_get(G_DALVIK_ARGS_OPERAND(operand), 0);
- reg = g_dec_context_convert_register(ctx, arg, false, addr);
-
- result = g_access_expression_new(G_DEC_EXPRESSION(reg), G_DEC_EXPRESSION(call));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/iput.c b/src/arch/dalvik/decomp/iput.c
deleted file mode 100644
index e55c7bc..0000000
--- a/src/arch/dalvik/decomp/iput.c
+++ /dev/null
@@ -1,79 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * iput.c - décompilation des instructions manipulant des champs d'instance (déchargement)
- *
- * 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 "translate.h"
-
-
-#include "../../../arch/dalvik/operands/pool.h"
-#include "../../../decomp/expr/access.h"
-#include "../../../decomp/expr/assign.h"
-#include "../../../decomp/expr/pseudo.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'iput'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_iput(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *dest; /* Registre de destination */
- GDecInstruction *src; /* Registre de l'object */
- uint32_t index; /* Indice dans la table */
- GDecInstruction *field; /* Champ concerné par l'opérat°*/
- GBinVariable *var; /* Variable / champ accédé */
- GDecInstruction *access; /* Représentation de l'accès */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- src = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- dest = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 2);
- index = g_dalvik_pool_operand_get_index(G_DALVIK_POOL_OPERAND(operand));
- var = get_field_from_dex_pool(G_DEX_FORMAT(g_dec_context_get_format(ctx)), index);
-
- field = g_pseudo_register_new(PRU_FIXED);
- g_pseudo_register_set_variable(G_PSEUDO_REGISTER(field), var);
-
- access = g_access_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(field));
- result = g_assign_expression_new(G_DEC_EXPRESSION(access), G_DEC_EXPRESSION(src));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/move.c b/src/arch/dalvik/decomp/move.c
deleted file mode 100644
index b147daf..0000000
--- a/src/arch/dalvik/decomp/move.c
+++ /dev/null
@@ -1,141 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * move.c - décompilation des opérations de déplacement
- *
- * 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 "translate.h"
-
-
-#include "../../../decomp/expr/assign.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'move'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_move(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *src; /* Registre de l'object */
- GDecInstruction *dest; /* Registre de destination */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- src = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(src));
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'move-object'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_move_object(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *src; /* Registre de l'object */
- GDecInstruction *dest; /* Registre de destination */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- src = g_dec_context_convert_register(ctx, operand, false, addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(src));
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'move-result'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_move_result(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- GDecInstruction *list; /* Instructions décompilées */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *last; /* Instruction précédante */
- GDecInstruction *dest; /* Registre de destination */
-
- list = g_dec_context_get_decomp_instrs(ctx);
- if (list == NULL) return NULL;
-
- last = g_dec_instruction_get_last(list);
- g_dec_instruction_delete(&list, last);
- g_dec_context_set_decomp_instrs(ctx, list);
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(last));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/new.c b/src/arch/dalvik/decomp/new.c
deleted file mode 100644
index ef143ff..0000000
--- a/src/arch/dalvik/decomp/new.c
+++ /dev/null
@@ -1,73 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * new.c - décompilation des créations de nouvelles instances
- *
- * 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 "translate.h"
-
-
-#include "../../../arch/dalvik/operands/pool.h"
-#include "../../../decomp/expr/assign.h"
-#include "../../../decomp/expr/call.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'new-instance'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_new_instance(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- uint32_t index; /* Indice dans la table */
- GDataType *type; /* Type concerné par l'opérat° */
- GBinRoutine *constructor; /* Constructeur reconstruit */
- GDecInstruction *call; /* Appel au constructeur */
- GDecInstruction *dest; /* Registre de destination */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 1);
- index = g_dalvik_pool_operand_get_index(G_DALVIK_POOL_OPERAND(operand));
- type = get_type_from_dex_pool(G_DEX_FORMAT(g_dec_context_get_format(ctx)), index);
-
- constructor = g_binary_routine_new_constructor(type);
- call = g_routine_call_new(constructor);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand, true, addr);
-
- result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(call));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/ret.c b/src/arch/dalvik/decomp/ret.c
deleted file mode 100644
index ab2f299..0000000
--- a/src/arch/dalvik/decomp/ret.c
+++ /dev/null
@@ -1,84 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * ret.c - décompilation 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 "translate.h"
-
-
-#include "../../../decomp/expr/return.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'return'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_return(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *reg; /* Pseudo-registre redéfini */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- reg = g_dec_context_convert_register(ctx, operand, false, addr);
-
- result = g_return_expression_new(G_DEC_EXPRESSION(reg));
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de type 'return-void'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_return_void(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
-
- result = g_return_expression_new(NULL);
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/switch.c b/src/arch/dalvik/decomp/switch.c
deleted file mode 100644
index 25501da..0000000
--- a/src/arch/dalvik/decomp/switch.c
+++ /dev/null
@@ -1,62 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * switch.c - décompilation 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 "translate.h"
-
-
-
-#include "../instruction.h"
-#include "../../../decomp/instr/switch.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction d'aiguillages multiples du flux. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *dalvik_decomp_instr_switch(const GArchInstruction *instr, GDecContext *ctx)
-{
- GDecInstruction *result; /* Instruction à retourner */
- vmpa_t addr; /* Adresse de l'instruction */
- GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *val; /* Valeur décidant du flot */
-
- g_arch_instruction_get_location(instr, NULL, NULL, &addr);
-
- operand = g_arch_instruction_get_operand(instr, 0);
- val = g_dec_context_convert_register(ctx, operand, false, addr);
-
- result = g_switch_instruction_new(G_DEC_EXPRESSION(val));
-
- return result;
-
-}
diff --git a/src/arch/dalvik/decomp/translate.h b/src/arch/dalvik/decomp/translate.h
deleted file mode 100644
index ff55a39..0000000
--- a/src/arch/dalvik/decomp/translate.h
+++ /dev/null
@@ -1,101 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * translate.h - prototypes pour les environnements de traduction d'instructions Dalvik
- *
- * 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 _ANALYSIS_DECOMP_RTL_DALVIK_TRANSLATE_H
-#define _ANALYSIS_DECOMP_RTL_DALVIK_TRANSLATE_H
-
-
-#include "../../translate.h"
-
-
-
-/* Décompile une instruction de type 'aget'. */
-GDecInstruction *dalvik_decomp_instr_aget(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'aput'. */
-GDecInstruction *dalvik_decomp_instr_aput(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'array-length'. */
-GDecInstruction *dalvik_decomp_instr_array_length(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'const'. */
-GDecInstruction *dalvik_decomp_instr_const(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'const-string'. */
-GDecInstruction *dalvik_decomp_instr_const_str(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'iget'. */
-GDecInstruction *dalvik_decomp_instr_iget(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'invoke-direct'. */
-GDecInstruction *dalvik_decomp_instr_invoke_direct(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'invoke-static'. */
-GDecInstruction *dalvik_decomp_instr_invoke_static(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'invoke-virtual'. */
-GDecInstruction *dalvik_decomp_instr_invoke_virtual(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'iput'. */
-GDecInstruction *dalvik_decomp_instr_iput(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'move'. */
-GDecInstruction *dalvik_decomp_instr_move(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'move-object'. */
-GDecInstruction *dalvik_decomp_instr_move_object(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'move-result'. */
-GDecInstruction *dalvik_decomp_instr_move_result(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'new-instance'. */
-GDecInstruction *dalvik_decomp_instr_new_instance(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'return'. */
-GDecInstruction *dalvik_decomp_instr_return(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'return-void'. */
-GDecInstruction *dalvik_decomp_instr_return_void(const GArchInstruction *, GDecContext *);
-
-
-/* Décompile une instruction de type 'opérations arithmétiques'. */
-GDecInstruction *dalvik_decomp_instr_arithm(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'opérations arithmétiques'. */
-GDecInstruction *dalvik_decomp_instr_arithm_2addr(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de type 'opérations arithmétiques'. */
-GDecInstruction *dalvik_decomp_instr_arithm_lit(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de branchement conditionnel. */
-GDecInstruction *dalvik_decomp_instr_if(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction de branchement conditionnel. */
-GDecInstruction *dalvik_decomp_instr_if_zero(const GArchInstruction *, GDecContext *);
-
-/* Décompile une instruction d'aiguillages multiples du flux. */
-GDecInstruction *dalvik_decomp_instr_switch(const GArchInstruction *, GDecContext *);
-
-
-
-#endif /* _ANALYSIS_DECOMP_RTL_DALVIK_TRANSLATE_H */
diff --git a/src/arch/dalvik/instruction.c b/src/arch/dalvik/instruction.c
index e3ece11..cc1cab2 100644
--- a/src/arch/dalvik/instruction.c
+++ b/src/arch/dalvik/instruction.c
@@ -28,7 +28,6 @@
#include "instruction-int.h"
-#include "decomp/translate.h"
#include "operands/register.h"
#include "../instruction-int.h"
#include "../register-int.h"
@@ -65,7 +64,8 @@ typedef struct _dalvik_instruction
const char *keyword; /* Mot clef de la commande */
- decomp_instr_fc decomp; /* Procédure de décompilation */
+ void *ptr;
+ //decomp_instr_fc decomp; /* Procédure de décompilation */
} dalvik_instruction;
@@ -73,40 +73,40 @@ typedef struct _dalvik_instruction
static dalvik_instruction _instructions[DOP_COUNT] = {
[DOP_NOP] = { 0x00, "nop", NULL },
- [DOP_MOVE] = { 0x01, "move", dalvik_decomp_instr_move },
+ [DOP_MOVE] = { 0x01, "move", NULL },
[DOP_MOVE_FROM_16] = { 0x02, "move/from16" },
[DOP_MOVE_16] = { 0x03, "move/16" },
[DOP_MOVE_WIDE] = { 0x04, "move-wide" },
[DOP_MOVE_WIDE_FROM_16] = { 0x05, "move-wide/from16" },
[DOP_MOVE_WIDE_16] = { 0x06, "move-wide/16" },
- [DOP_MOVE_OBJECT] = { 0x07, "move-object", dalvik_decomp_instr_move_object },
+ [DOP_MOVE_OBJECT] = { 0x07, "move-object", NULL },
[DOP_MOVE_OBJECT_FROM_16] = { 0x08, "move-object/from16" },
[DOP_MOVE_OBJECT_16] = { 0x09, "move-object/16" },
- [DOP_MOVE_RESULT] = { 0x0a, "move-result", dalvik_decomp_instr_move_result },
- [DOP_MOVE_RESULT_WIDE] = { 0x0b, "move-result-wide", dalvik_decomp_instr_move_result },
- [DOP_MOVE_RESULT_OBJECT] = { 0x0c, "move-result-object", dalvik_decomp_instr_move_result },
+ [DOP_MOVE_RESULT] = { 0x0a, "move-result", NULL },
+ [DOP_MOVE_RESULT_WIDE] = { 0x0b, "move-result-wide", NULL },
+ [DOP_MOVE_RESULT_OBJECT] = { 0x0c, "move-result-object", NULL },
[DOP_MOVE_EXCEPTION] = { 0x0d, "move-exception" },
- [DOP_RETURN_VOID] = { 0x0e, "return-void", dalvik_decomp_instr_return_void },
- [DOP_RETURN] = { 0x0f, "return", dalvik_decomp_instr_return },
- [DOP_RETURN_WIDE] = { 0x10, "return-wide", dalvik_decomp_instr_return },
- [DOP_RETURN_OBJECT] = { 0x11, "return-object", dalvik_decomp_instr_return },
- [DOP_CONST_4] = { 0x12, "const/4", dalvik_decomp_instr_const },
- [DOP_CONST_16] = { 0x13, "const/16", dalvik_decomp_instr_const },
+ [DOP_RETURN_VOID] = { 0x0e, "return-void", NULL },
+ [DOP_RETURN] = { 0x0f, "return", NULL },
+ [DOP_RETURN_WIDE] = { 0x10, "return-wide", NULL },
+ [DOP_RETURN_OBJECT] = { 0x11, "return-object", NULL },
+ [DOP_CONST_4] = { 0x12, "const/4", NULL },
+ [DOP_CONST_16] = { 0x13, "const/16", NULL },
[DOP_CONST] = { 0x14, "const" },
[DOP_CONST_HIGH16] = { 0x15, "const/high16" },
[DOP_CONST_WIDE_16] = { 0x16, "const-wide/16" },
[DOP_CONST_WIDE_32] = { 0x17, "const-wide/32" },
[DOP_CONST_WIDE] = { 0x18, "const-wide" },
[DOP_CONST_WIDE_HIGH16] = { 0x19, "const-wide/high16" },
- [DOP_CONST_STRING] = { 0x1a, "const-string", dalvik_decomp_instr_const_str },
+ [DOP_CONST_STRING] = { 0x1a, "const-string", NULL },
[DOP_CONST_STRING_JUMBO] = { 0x1b, "const-string/jumbo" },
[DOP_CONST_CLASS] = { 0x1c, "const-class" },
[DOP_MONITOR_ENTER] = { 0x1d, "monitor-enter" },
[DOP_MONITOR_EXIT] = { 0x1e, "monitor-exit" },
[DOP_CHECK_CAST] = { 0x1f, "check-cast" },
[DOP_INSTANCE_OF] = { 0x20, "instance-of" },
- [DOP_ARRAY_LENGTH] = { 0x21, "array-length", dalvik_decomp_instr_array_length },
- [DOP_NEW_INSTANCE] = { 0x22, "new-instance", dalvik_decomp_instr_new_instance },
+ [DOP_ARRAY_LENGTH] = { 0x21, "array-length", NULL },
+ [DOP_NEW_INSTANCE] = { 0x22, "new-instance", NULL },
[DOP_NEW_ARRAY] = { 0x23, "new-array" },
[DOP_FILLED_NEW_ARRAY] = { 0x24, "fill-new-array" },
[DOP_FILLED_NEW_ARRAY_RANGE]= { 0x25, "fill-new-array/range" },
@@ -115,25 +115,25 @@ static dalvik_instruction _instructions[DOP_COUNT] = {
[DOP_GOTO] = { 0x28, "goto" },
[DOP_GOTO_16] = { 0x29, "goto/16" },
[DOP_GOTO_32] = { 0x2a, "goto/32" },
- [DOP_PACKED_SWITCH] = { 0x2b, "packed-switch", dalvik_decomp_instr_switch },
- [DOP_SPARSE_SWITCH] = { 0x2c, "sparse-switch", dalvik_decomp_instr_switch },
+ [DOP_PACKED_SWITCH] = { 0x2b, "packed-switch", NULL },
+ [DOP_SPARSE_SWITCH] = { 0x2c, "sparse-switch", NULL },
[DOP_CMPL_FLOAT] = { 0x2d, "cmp-long" },
[DOP_CMPG_FLOAT] = { 0x2e, "cmpg-float" },
[DOP_CMPL_DOUBLE] = { 0x2f, "cmpl-double" },
[DOP_CMPG_DOUBLE] = { 0x30, "cmpg-double" },
[DOP_CMP_LONG] = { 0x31, "cmp-long" },
- [DOP_IF_EQ] = { 0x32, "if-eq", dalvik_decomp_instr_if },
- [DOP_IF_NE] = { 0x33, "if-ne", dalvik_decomp_instr_if },
- [DOP_IF_LT] = { 0x34, "if-lt", dalvik_decomp_instr_if },
- [DOP_IF_GE] = { 0x35, "if-ge", dalvik_decomp_instr_if },
- [DOP_IF_GT] = { 0x36, "if-gt", dalvik_decomp_instr_if },
- [DOP_IF_LE] = { 0x37, "if-le", dalvik_decomp_instr_if },
- [DOP_IF_EQZ] = { 0x38, "if-eqz", dalvik_decomp_instr_if_zero },
- [DOP_IF_NEZ] = { 0x39, "if-nez", dalvik_decomp_instr_if_zero },
- [DOP_IF_LTZ] = { 0x3a, "if-ltz", dalvik_decomp_instr_if_zero },
- [DOP_IF_GEZ] = { 0x3b, "if-gez", dalvik_decomp_instr_if_zero },
- [DOP_IF_GTZ] = { 0x3c, "if-gtz", dalvik_decomp_instr_if_zero },
- [DOP_IF_LEZ] = { 0x3d, "if-lez", dalvik_decomp_instr_if_zero },
+ [DOP_IF_EQ] = { 0x32, "if-eq", NULL },
+ [DOP_IF_NE] = { 0x33, "if-ne", NULL },
+ [DOP_IF_LT] = { 0x34, "if-lt", NULL },
+ [DOP_IF_GE] = { 0x35, "if-ge", NULL },
+ [DOP_IF_GT] = { 0x36, "if-gt", NULL },
+ [DOP_IF_LE] = { 0x37, "if-le", NULL },
+ [DOP_IF_EQZ] = { 0x38, "if-eqz", NULL },
+ [DOP_IF_NEZ] = { 0x39, "if-nez", NULL },
+ [DOP_IF_LTZ] = { 0x3a, "if-ltz", NULL },
+ [DOP_IF_GEZ] = { 0x3b, "if-gez", NULL },
+ [DOP_IF_GTZ] = { 0x3c, "if-gtz", NULL },
+ [DOP_IF_LEZ] = { 0x3d, "if-lez", NULL },
[DOP_UNUSED_3E] = { 0x3e, NULL /* unused */ },
[DOP_UNUSED_3F] = { 0x3f, NULL /* unused */ },
[DOP_UNUSED_40] = { 0x40, NULL /* unused */ },
@@ -144,24 +144,24 @@ static dalvik_instruction _instructions[DOP_COUNT] = {
[DOP_AGET_WIDE] = { 0x45, "aget-wide" },
[DOP_AGET_OBJECT] = { 0x46, "aget-object" },
[DOP_AGET_BOOLEAN] = { 0x47, "aget-boolean" },
- [DOP_AGET_BYTE] = { 0x48, "aget-byte", dalvik_decomp_instr_aget },
+ [DOP_AGET_BYTE] = { 0x48, "aget-byte", NULL },
[DOP_AGET_CHAR] = { 0x49, "aget-char" },
[DOP_AGET_SHORT] = { 0x4a, "aget-short" },
[DOP_APUT] = { 0x4b, "aput" },
[DOP_APUT_WIDE] = { 0x4c, "aput-wide" },
[DOP_APUT_OBJECT] = { 0x4d, "aput-object" },
[DOP_APUT_BOOLEAN] = { 0x4e, "aput-boolean" },
- [DOP_APUT_BYTE] = { 0x4f, "aput-byte", dalvik_decomp_instr_aput },
+ [DOP_APUT_BYTE] = { 0x4f, "aput-byte", NULL },
[DOP_APUT_CHAR] = { 0x50, "aput-char" },
[DOP_APUT_SHORT] = { 0x51, "aput-short" },
- [DOP_IGET] = { 0x52, "iget", dalvik_decomp_instr_iget },
+ [DOP_IGET] = { 0x52, "iget", NULL },
[DOP_IGET_WIDE] = { 0x53, "iget-wide" },
[DOP_IGET_OBJECT] = { 0x54, "iget-object" },
[DOP_IGET_BOOLEAN] = { 0x55, "iget-boolean" },
[DOP_IGET_BYTE] = { 0x56, "iget-byte" },
[DOP_IGET_CHAR] = { 0x57, "iget-char" },
[DOP_IGET_SHORT] = { 0x58, "iget-short" },
- [DOP_IPUT] = { 0x59, "iput", dalvik_decomp_instr_iput },
+ [DOP_IPUT] = { 0x59, "iput", NULL },
[DOP_IPUT_WIDE] = { 0x5a, "iput-wide" },
[DOP_IPUT_OBJECT] = { 0x5b, "iput-object" },
[DOP_IPUT_BOOLEAN] = { 0x5c, "iput-boolean" },
@@ -182,10 +182,10 @@ static dalvik_instruction _instructions[DOP_COUNT] = {
[DOP_SPUT_BYTE] = { 0x6b, "sput-byte" },
[DOP_SPUT_CHAR] = { 0x6c, "sput-char" },
[DOP_SPUT_SHORT] = { 0x6d, "sput-short" },
- [DOP_INVOKE_VIRTUAL] = { 0x6e, "invoke-virtual", dalvik_decomp_instr_invoke_virtual },
+ [DOP_INVOKE_VIRTUAL] = { 0x6e, "invoke-virtual", NULL },
[DOP_INVOKE_SUPER] = { 0x6f, "invoke-static" },
- [DOP_INVOKE_DIRECT] = { 0x70, "invoke-direct", dalvik_decomp_instr_invoke_direct },
- [DOP_INVOKE_STATIC] = { 0x71, "invoke-static", dalvik_decomp_instr_invoke_static },
+ [DOP_INVOKE_DIRECT] = { 0x70, "invoke-direct", NULL },
+ [DOP_INVOKE_STATIC] = { 0x71, "invoke-static", NULL },
[DOP_INVOKE_INTERFACE] = { 0x72, "invoke-interface" },
[DOP_UNUSED_73] = { 0x73, NULL /* unused */ },
[DOP_INVOKE_VIRTUAL_RANGE] = { 0x74, "invoke-virtual/range" },
@@ -216,14 +216,14 @@ static dalvik_instruction _instructions[DOP_COUNT] = {
[DOP_TO_INT_BYTE] = { 0x8d, "int-to-byte" },
[DOP_TO_INT_CHAR] = { 0x8e, "int-to-char" },
[DOP_TO_INT_SHORT] = { 0x8f, "int-to-short" },
- [DOP_ADD_INT] = { 0x90, "add-int", dalvik_decomp_instr_arithm },
- [DOP_SUB_INT] = { 0x91, "sub-int", dalvik_decomp_instr_arithm },
- [DOP_MUL_INT] = { 0x92, "mul-int", dalvik_decomp_instr_arithm },
- [DOP_DIV_INT] = { 0x93, "div-int", dalvik_decomp_instr_arithm },
- [DOP_REM_INT] = { 0x94, "rem-int", dalvik_decomp_instr_arithm },
- [DOP_AND_INT] = { 0x95, "and-int", dalvik_decomp_instr_arithm },
- [DOP_OR_INT] = { 0x96, "or-int", dalvik_decomp_instr_arithm },
- [DOP_XOR_INT] = { 0x97, "xor-int", dalvik_decomp_instr_arithm },
+ [DOP_ADD_INT] = { 0x90, "add-int", NULL },
+ [DOP_SUB_INT] = { 0x91, "sub-int", NULL },
+ [DOP_MUL_INT] = { 0x92, "mul-int", NULL },
+ [DOP_DIV_INT] = { 0x93, "div-int", NULL },
+ [DOP_REM_INT] = { 0x94, "rem-int", NULL },
+ [DOP_AND_INT] = { 0x95, "and-int", NULL },
+ [DOP_OR_INT] = { 0x96, "or-int", NULL },
+ [DOP_XOR_INT] = { 0x97, "xor-int", NULL },
[DOP_SHL_INT] = { 0x98, "shl-int" },
[DOP_SHR_INT] = { 0x99, "shr-int" },
[DOP_USHR_INT] = { 0x9a, "ushr-int" },
@@ -248,54 +248,54 @@ static dalvik_instruction _instructions[DOP_COUNT] = {
[DOP_MUL_DOUBLE] = { 0xad, "mul-double" },
[DOP_DIV_DOUBLE] = { 0xae, "div-double" },
[DOP_REM_DOUBLE] = { 0xaf, "rem-double" },
- [DOP_ADD_INT_2ADDR] = { 0xb0, "add-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_SUB_INT_2ADDR] = { 0xb1, "sub-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_MUL_INT_2ADDR] = { 0xb2, "mul-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_DIV_INT_2ADDR] = { 0xb3, "div-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_REM_INT_2ADDR] = { 0xb4, "rem-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_AND_INT_2ADDR] = { 0xb5, "and-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_OR_INT_2ADDR] = { 0xb6, "or-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_XOR_INT_2ADDR] = { 0xb7, "xor-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_SHL_INT_2ADDR] = { 0xb8, "shl-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_SHR_INT_2ADDR] = { 0xb9, "shr-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_USHR_INT_2ADDR] = { 0xba, "ushr-int/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_ADD_LONG_2ADDR] = { 0xbb, "add-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_SUB_LONG_2ADDR] = { 0xbc, "sub-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_MUL_LONG_2ADDR] = { 0xbd, "mul-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_DIV_LONG_2ADDR] = { 0xbe, "div-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_REM_LONG_2ADDR] = { 0xbf, "rem-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_AND_LONG_2ADDR] = { 0xc0, "and-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_OR_LONG_2ADDR] = { 0xc1, "or-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_XOR_LONG_2ADDR] = { 0xc2, "xor-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_SHL_LONG_2ADDR] = { 0xc3, "shl-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_SHR_LONG_2ADDR] = { 0xc4, "shr-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_USHR_LONG_2ADDR] = { 0xc5, "ushr-long/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_ADD_FLOAT_2ADDR] = { 0xc6, "add-float/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_SUB_FLOAT_2ADDR] = { 0xc7, "sub-float/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_MUL_FLOAT_2ADDR] = { 0xc8, "mul-float/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_DIV_FLOAT_2ADDR] = { 0xc9, "div-float/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_REM_FLOAT_2ADDR] = { 0xca, "rem-float/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_ADD_DOUBLE_2ADDR] = { 0xcb, "add-double/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_SUB_DOUBLE_2ADDR] = { 0xcc, "sub-double/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_MUL_DOUBLE_2ADDR] = { 0xcd, "mul-double/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_DIV_DOUBLE_2ADDR] = { 0xce, "div-double/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_REM_DOUBLE_2ADDR] = { 0xcf, "rem-double/2addr", dalvik_decomp_instr_arithm_2addr },
- [DOP_ADD_INT_LIT16] = { 0xd0, "add-int/lit16", dalvik_decomp_instr_arithm_lit },
+ [DOP_ADD_INT_2ADDR] = { 0xb0, "add-int/2addr", NULL },
+ [DOP_SUB_INT_2ADDR] = { 0xb1, "sub-int/2addr", NULL },
+ [DOP_MUL_INT_2ADDR] = { 0xb2, "mul-int/2addr", NULL },
+ [DOP_DIV_INT_2ADDR] = { 0xb3, "div-int/2addr", NULL },
+ [DOP_REM_INT_2ADDR] = { 0xb4, "rem-int/2addr", NULL },
+ [DOP_AND_INT_2ADDR] = { 0xb5, "and-int/2addr", NULL },
+ [DOP_OR_INT_2ADDR] = { 0xb6, "or-int/2addr", NULL },
+ [DOP_XOR_INT_2ADDR] = { 0xb7, "xor-int/2addr", NULL },
+ [DOP_SHL_INT_2ADDR] = { 0xb8, "shl-int/2addr", NULL },
+ [DOP_SHR_INT_2ADDR] = { 0xb9, "shr-int/2addr", NULL },
+ [DOP_USHR_INT_2ADDR] = { 0xba, "ushr-int/2addr", NULL },
+ [DOP_ADD_LONG_2ADDR] = { 0xbb, "add-long/2addr", NULL },
+ [DOP_SUB_LONG_2ADDR] = { 0xbc, "sub-long/2addr", NULL },
+ [DOP_MUL_LONG_2ADDR] = { 0xbd, "mul-long/2addr", NULL },
+ [DOP_DIV_LONG_2ADDR] = { 0xbe, "div-long/2addr", NULL },
+ [DOP_REM_LONG_2ADDR] = { 0xbf, "rem-long/2addr", NULL },
+ [DOP_AND_LONG_2ADDR] = { 0xc0, "and-long/2addr", NULL },
+ [DOP_OR_LONG_2ADDR] = { 0xc1, "or-long/2addr", NULL },
+ [DOP_XOR_LONG_2ADDR] = { 0xc2, "xor-long/2addr", NULL },
+ [DOP_SHL_LONG_2ADDR] = { 0xc3, "shl-long/2addr", NULL },
+ [DOP_SHR_LONG_2ADDR] = { 0xc4, "shr-long/2addr", NULL },
+ [DOP_USHR_LONG_2ADDR] = { 0xc5, "ushr-long/2addr", NULL },
+ [DOP_ADD_FLOAT_2ADDR] = { 0xc6, "add-float/2addr", NULL },
+ [DOP_SUB_FLOAT_2ADDR] = { 0xc7, "sub-float/2addr", NULL },
+ [DOP_MUL_FLOAT_2ADDR] = { 0xc8, "mul-float/2addr", NULL },
+ [DOP_DIV_FLOAT_2ADDR] = { 0xc9, "div-float/2addr", NULL },
+ [DOP_REM_FLOAT_2ADDR] = { 0xca, "rem-float/2addr", NULL },
+ [DOP_ADD_DOUBLE_2ADDR] = { 0xcb, "add-double/2addr", NULL },
+ [DOP_SUB_DOUBLE_2ADDR] = { 0xcc, "sub-double/2addr", NULL },
+ [DOP_MUL_DOUBLE_2ADDR] = { 0xcd, "mul-double/2addr", NULL },
+ [DOP_DIV_DOUBLE_2ADDR] = { 0xce, "div-double/2addr", NULL },
+ [DOP_REM_DOUBLE_2ADDR] = { 0xcf, "rem-double/2addr", NULL },
+ [DOP_ADD_INT_LIT16] = { 0xd0, "add-int/lit16", NULL },
[DOP_RSUB_INT] = { 0xd1, "rsub-int" },
- [DOP_MUL_INT_LIT16] = { 0xd2, "mul-int/lit16", dalvik_decomp_instr_arithm_lit },
- [DOP_DIV_INT_LIT16] = { 0xd3, "div-int/lit16", dalvik_decomp_instr_arithm_lit },
- [DOP_REM_INT_LIT16] = { 0xd4, "rem-int/lit16", dalvik_decomp_instr_arithm_lit },
- [DOP_AND_INT_LIT16] = { 0xd5, "and-int/lit16", dalvik_decomp_instr_arithm_lit },
- [DOP_OR_INT_LIT16] = { 0xd6, "or-int/lit16", dalvik_decomp_instr_arithm_lit },
- [DOP_XOR_INT_LIT16] = { 0xd7, "xor-int/lit16", dalvik_decomp_instr_arithm_lit },
- [DOP_ADD_INT_LIT8] = { 0xd8, "add-int/lit8", dalvik_decomp_instr_arithm_lit },
+ [DOP_MUL_INT_LIT16] = { 0xd2, "mul-int/lit16", NULL },
+ [DOP_DIV_INT_LIT16] = { 0xd3, "div-int/lit16", NULL },
+ [DOP_REM_INT_LIT16] = { 0xd4, "rem-int/lit16", NULL },
+ [DOP_AND_INT_LIT16] = { 0xd5, "and-int/lit16", NULL },
+ [DOP_OR_INT_LIT16] = { 0xd6, "or-int/lit16", NULL },
+ [DOP_XOR_INT_LIT16] = { 0xd7, "xor-int/lit16", NULL },
+ [DOP_ADD_INT_LIT8] = { 0xd8, "add-int/lit8", NULL },
[DOP_RSUB_INT_LIT8] = { 0xd9, "rsub-int/lit8" },
- [DOP_MUL_INT_LIT8] = { 0xda, "mul-int/lit8", dalvik_decomp_instr_arithm_lit },
- [DOP_DIV_INT_LIT8] = { 0xdb, "div-int/lit8", dalvik_decomp_instr_arithm_lit },
- [DOP_REM_INT_LIT8] = { 0xdc, "rem-int/lit8", dalvik_decomp_instr_arithm_lit },
- [DOP_AND_INT_LIT8] = { 0xdd, "and-int/lit8", dalvik_decomp_instr_arithm_lit },
- [DOP_OR_INT_LIT8] = { 0xde, "or-int/lit8", dalvik_decomp_instr_arithm_lit },
- [DOP_XOR_INT_LIT8] = { 0xdf, "xor-int/lit8", dalvik_decomp_instr_arithm_lit },
+ [DOP_MUL_INT_LIT8] = { 0xda, "mul-int/lit8", NULL },
+ [DOP_DIV_INT_LIT8] = { 0xdb, "div-int/lit8", NULL },
+ [DOP_REM_INT_LIT8] = { 0xdc, "rem-int/lit8", NULL },
+ [DOP_AND_INT_LIT8] = { 0xdd, "and-int/lit8", NULL },
+ [DOP_OR_INT_LIT8] = { 0xde, "or-int/lit8", NULL },
+ [DOP_XOR_INT_LIT8] = { 0xdf, "xor-int/lit8", NULL },
[DOP_SHL_INT_LIT8] = { 0xe0, "shl-int/lit8" },
[DOP_SHR_INT_LIT8] = { 0xe1, "shr-int/lit8" },
[DOP_USHR_INT_LIT8] = { 0xe2, "ushr-int/lit8" },
@@ -336,7 +336,7 @@ static dalvik_instruction _instructions[DOP_COUNT] = {
static const char *dalvik_instruction_get_keyword(const GDalvikInstruction *, AsmSyntax);
/* Décompile une instruction de la machine virtuelle Dalvik. */
-GDecInstruction *dalvik_instruction_decompile(const GDalvikInstruction *, GDecContext *);
+//GDecInstruction *dalvik_instruction_decompile(const GDalvikInstruction *, GDecContext *);
@@ -592,7 +592,7 @@ static const char *dalvik_instruction_get_keyword(const GDalvikInstruction *inst
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
GDecInstruction *dalvik_instruction_decompile(const GDalvikInstruction *instr, GDecContext *ctx)
{
GDecInstruction *result; /* Instruction à retourner */
@@ -606,3 +606,4 @@ GDecInstruction *dalvik_instruction_decompile(const GDalvikInstruction *instr, G
return result;
}
+#endif
diff --git a/src/arch/dalvik/processor.c b/src/arch/dalvik/processor.c
index d08d0b2..a7a95c3 100644
--- a/src/arch/dalvik/processor.c
+++ b/src/arch/dalvik/processor.c
@@ -69,7 +69,7 @@ static void g_dalvik_processor_finalize(GDalvikProcessor *);
static GDalvikContext *g_dalvik_processor_get_context(const GDalvikProcessor *);
/* Fournit un contexte pour la décompilation Dalvik. */
-static GDalvikDContext *g_dalvik_processor_get_decomp_context(const GDalvikProcessor *);
+//static GDalvikDContext *g_dalvik_processor_get_decomp_context(const GDalvikProcessor *);
/* Décode une instruction dans un flux de données. */
static GArchInstruction *g_dalvik_processor_disassemble(const GArchProcessor *, GDalvikContext *, const GBinContent *, vmpa2t *, GExeFormat *);
@@ -136,7 +136,7 @@ static void g_dalvik_processor_init(GDalvikProcessor *proc)
parent->inssize = MDS_16_BITS;
parent->get_ctx = (get_processor_context_fc)g_dalvik_processor_get_context;
- parent->get_dec_ctx = (get_decomp_context_fc)g_dalvik_processor_get_decomp_context;
+ //parent->get_dec_ctx = (get_decomp_context_fc)g_dalvik_processor_get_decomp_context;
}
@@ -232,12 +232,13 @@ static GDalvikContext *g_dalvik_processor_get_context(const GDalvikProcessor *pr
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
static GDalvikDContext *g_dalvik_processor_get_decomp_context(const GDalvikProcessor *proc)
{
return g_dalvik_dcontext_new();
}
+#endif
/******************************************************************************
diff --git a/src/arch/instruction-int.h b/src/arch/instruction-int.h
index 0d0b639..c7f32e7 100644
--- a/src/arch/instruction-int.h
+++ b/src/arch/instruction-int.h
@@ -27,7 +27,6 @@
#include "archbase.h"
#include "instruction.h"
-#include "translate.h"
#include "../common/dllist.h"
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index e3490a8..7106631 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -976,55 +976,6 @@ GBufferLine *g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer
}
-/******************************************************************************
-* *
-* Paramètres : instr = instruction d'origine à convertir. *
-* ctx = contexte de la phase de décompilation. *
-* *
-* Description : Décompile une instruction de façon générique. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GDecInstruction *g_arch_instruction_decompile(const GArchInstruction *instr, GDecContext *ctx)
-{
-#if 0
-
- GDecInstruction *result; /* Instruction à retourner */
- GDecInstruction *list; /* Instructions décompilées */
-
- if (instr->decomp != NULL)
- {
- result = instr->decomp(instr, ctx);
-
- if (result != NULL)
- {
- list = g_dec_context_get_decomp_instrs(ctx);
-
- if (list == NULL) list = result;
- else g_dec_instruction_add_to_list(&list, result);
-
- g_dec_context_set_decomp_instrs(ctx, list);
-
- }
-
- }
-
- else
- result = NULL;
-
- return result;
-
-#endif
-
- return NULL;
-
-}
-
-
/* ---------------------------------------------------------------------------------- */
/* TRAITEMENT DES INSTRUCTIONS PAR ENSEMBLE */
/* ---------------------------------------------------------------------------------- */
diff --git a/src/arch/instruction.h b/src/arch/instruction.h
index d87eb1c..d625e77 100644
--- a/src/arch/instruction.h
+++ b/src/arch/instruction.h
@@ -34,10 +34,8 @@
#include "vmpa.h"
#include "../analysis/content.h"
#include "../analysis/type.h"
-#include "../decomp/context.h"
-#include "../decomp/instruction.h"
#include "../format/executable.h"
-//#include "../format/format.h"
+#include "../glibext/gcodebuffer.h"
@@ -227,9 +225,6 @@ void g_arch_instruction_set_displayed_max_length(GArchInstruction *, phys_t);
/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
GBufferLine *g_arch_instruction_print(const GArchInstruction *, GCodeBuffer *, MemoryDataSize, const GBinContent *, AsmSyntax);
-/* Décompile une instruction de façon générique. */
-GDecInstruction *g_arch_instruction_decompile(const GArchInstruction *, GDecContext *) __attribute__ ((deprecated));
-
/* -------------------- TRAITEMENT DES INSTRUCTIONS PAR ENSEMBLE -------------------- */
diff --git a/src/arch/processor-int.h b/src/arch/processor-int.h
index c92f668..8631731 100644
--- a/src/arch/processor-int.h
+++ b/src/arch/processor-int.h
@@ -52,7 +52,7 @@
typedef GProcContext * (* get_processor_context_fc) (const GArchProcessor *);
/* Fournit un contexte lié au processeur pour une décompilation. */
-typedef GDecContext * (* get_decomp_context_fc) (const GArchProcessor *);
+//typedef GDecContext * (* get_decomp_context_fc) (const GArchProcessor *);
/* Désassemble une instruction dans un flux de données. */
typedef GArchInstruction * (* disass_instr_fc) (const GArchProcessor *, GProcContext *, const GBinContent *, vmpa2t *, GExeFormat *);
@@ -82,7 +82,7 @@ struct _GArchProcessor
MemoryDataSize inssize; /* Taille min. d'encodage */
get_processor_context_fc get_ctx; /* Obtention d'un contexte #1 */
- get_decomp_context_fc get_dec_ctx; /* Obtention d'un contexte #2 */
+ //get_decomp_context_fc get_dec_ctx; /* Obtention d'un contexte #2 */
GArchInstruction **instructions; /* Instructions désassemblées */
size_t instr_allocated; /* Taille de la liste allouée */
diff --git a/src/arch/processor.c b/src/arch/processor.c
index bfbc2db..615aa86 100644
--- a/src/arch/processor.c
+++ b/src/arch/processor.c
@@ -157,7 +157,7 @@ GProcContext *g_arch_processor_get_context(const GArchProcessor *proc)
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
GDecContext *g_arch_processor_get_decomp_context(const GArchProcessor *proc)
{
GDecContext *result; /* Contexte à retourner */
@@ -171,6 +171,7 @@ GDecContext *g_arch_processor_get_decomp_context(const GArchProcessor *proc)
return result;
}
+#endif
/******************************************************************************
diff --git a/src/arch/processor.h b/src/arch/processor.h
index 5fb3def..f0f9b55 100644
--- a/src/arch/processor.h
+++ b/src/arch/processor.h
@@ -31,7 +31,7 @@
#include "context.h"
#include "instruction.h"
#include "../common/endianness.h"
-#include "../decomp/context.h"
+#include "../format/executable.h"
@@ -58,7 +58,7 @@ GType g_arch_processor_get_type(void);
GProcContext *g_arch_processor_get_context(const GArchProcessor *);
/* Fournit un contexte lié au processeur pour une décompilation. */
-GDecContext *g_arch_processor_get_decomp_context(const GArchProcessor *);
+//GDecContext *g_arch_processor_get_decomp_context(const GArchProcessor *);
/* Fournit le boustime du processeur d'une architecture. */
SourceEndian g_arch_processor_get_endianness(const GArchProcessor *);
diff --git a/src/arch/translate.h b/src/arch/translate.h
deleted file mode 100644
index 940fd76..0000000
--- a/src/arch/translate.h
+++ /dev/null
@@ -1,39 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * translate.h - prototypes pour les environnements de traduction d'instructions
- *
- * 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 _ARCH_TRANSLATE_H
-#define _ARCH_TRANSLATE_H
-
-
-#include "instruction.h"
-#include "../decomp/context.h"
-#include "../decomp/instruction.h"
-
-
-
-/* Décompile une instruction quelconque. */
-typedef GDecInstruction * (* decomp_instr_fc) (const GArchInstruction *, GDecContext *);
-
-
-
-#endif /* _ANALYSIS_DECOMP_RTL_TRANSLATE_H */
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 */
diff --git a/src/format/dex/class.c b/src/format/dex/class.c
index c0fde56..26907ed 100644
--- a/src/format/dex/class.c
+++ b/src/format/dex/class.c
@@ -509,7 +509,7 @@ const char *g_dex_class_get_source_file(const GDexClass *class, const GDexFormat
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
void g_dex_class_decompile(const GDexClass *class, GLangOutput *lang, GCodeBuffer *buffer, const GDexFormat *format)
{
@@ -571,17 +571,4 @@ GBufferLine *line, GLangOutput *output)
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+#endif
diff --git a/src/format/dex/class.h b/src/format/dex/class.h
index 044ace6..46529c3 100644
--- a/src/format/dex/class.h
+++ b/src/format/dex/class.h
@@ -30,7 +30,6 @@
#include "dex.h"
#include "method.h"
-#include "../../decomp/output.h"
@@ -79,7 +78,7 @@ GDexMethod *g_dex_class_find_method_by_address(const GDexClass *, vmpa_t);
const char *g_dex_class_get_source_file(const GDexClass *, const GDexFormat *);
/* Procède à la décompilation complète d'une classe donnée. */
-void g_dex_class_decompile(const GDexClass *, GLangOutput *, GCodeBuffer *, const GDexFormat *);
+//void g_dex_class_decompile(const GDexClass *, GLangOutput *, GCodeBuffer *, const GDexFormat *);
diff --git a/src/format/dex/method.c b/src/format/dex/method.c
index 2083293..1223eb9 100644
--- a/src/format/dex/method.c
+++ b/src/format/dex/method.c
@@ -466,9 +466,10 @@ DexVariableIndex g_dex_method_get_variable(const GDexMethod *method, uint32_t in
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
void g_dex_method_decompile(const GDexMethod *method, GLangOutput *lang, GCodeBuffer *buffer)
{
g_binary_routine_print_code(method->routine, lang, buffer, true);
}
+#endif
diff --git a/src/format/dex/method.h b/src/format/dex/method.h
index bc07ab9..41ddb4c 100644
--- a/src/format/dex/method.h
+++ b/src/format/dex/method.h
@@ -91,7 +91,7 @@ bool g_dex_method_get_offset(const GDexMethod *method, phys_t *);
DexVariableIndex g_dex_method_get_variable(const GDexMethod *, uint32_t);
/* Procède à la décompilation complète d'une routine donnée. */
-void g_dex_method_decompile(const GDexMethod *, GLangOutput *, GCodeBuffer *);
+//void g_dex_method_decompile(const GDexMethod *, GLangOutput *, GCodeBuffer *);
diff --git a/src/format/format.c b/src/format/format.c
index 771d46e..bf4a0e1 100644
--- a/src/format/format.c
+++ b/src/format/format.c
@@ -38,7 +38,6 @@
#include "pe/pe.h"
#include "../arch/processor.h"
#include "../common/sort.h"
-#include "../decomp/expr/block.h"
#include "../gui/panels/log.h"
#include "../plugins/pglist.h"
@@ -911,7 +910,7 @@ const char * const *g_binary_format_get_source_files(const GBinFormat *format, s
* Remarques : - *
* *
******************************************************************************/
-
+#if 0
void g_binary_format_decompile(const GBinFormat *format, GCodeBuffer *buffer, const char *filename)
{
@@ -951,3 +950,4 @@ void g_binary_format_decompile(const GBinFormat *format, GCodeBuffer *buffer, co
}
}
+#endif
diff --git a/src/format/format.h b/src/format/format.h
index 45a67eb..5298b5f 100644
--- a/src/format/format.h
+++ b/src/format/format.h
@@ -101,7 +101,7 @@ GBinRoutine **g_binary_format_get_routines(const GBinFormat *, size_t *);
const char * const *g_binary_format_get_source_files(const GBinFormat *, size_t *, size_t *);
/* Procède à la décompilation complète du format. */
-void g_binary_format_decompile(const GBinFormat *, GCodeBuffer *, const char *filename);
+//void g_binary_format_decompile(const GBinFormat *, GCodeBuffer *, const char *filename);