summaryrefslogtreecommitdiff
path: root/src/analysis/decomp
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/decomp')
-rw-r--r--src/analysis/decomp/decompiler.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/analysis/decomp/decompiler.c b/src/analysis/decomp/decompiler.c
index b144846..24cd242 100644
--- a/src/analysis/decomp/decompiler.c
+++ b/src/analysis/decomp/decompiler.c
@@ -130,16 +130,19 @@ static void build_decomp_prologue(GCodeBuffer *buffer, const char *filename)
static void prepare_all_routines_for_decomp(const GOpenidaBinary *binary, const char *filename)
{
GExeFormat *format; /* Format du binaire fourni */
+ GArchProcessor *proc; /* Architecture du binaire */
GBinRoutine **routines;
size_t count;
size_t i;
+ GDecContext *context; /* Contexte pour la décompil. */
GDecInstruction *instr;
format = g_openida_binary_get_format(binary);
-
+ proc = get_arch_processor_from_format(G_EXE_FORMAT(format));
+
routines = g_binary_format_get_routines(G_BIN_FORMAT(format), &count);
@@ -147,16 +150,14 @@ static void prepare_all_routines_for_decomp(const GOpenidaBinary *binary, const
for (i = 0; i < count; i++)
{
- printf(" -- %s --\n", g_binary_routine_get_name(routines[i]));
+ context = g_arch_processor_get_decomp_context(proc);
- //if (strcmp("fib2", g_binary_routine_get_name(routines[i])) == 0)
- {
-
- printf("...\n");
+ printf(" -- %s --\n", g_binary_routine_get_name(routines[i]));
- instr = g_binary_format_decompile_routine(G_BIN_FORMAT(format), routines[i]);
+ instr = g_binary_format_decompile_routine(G_BIN_FORMAT(format), routines[i], context);
- }
+ if (context != NULL)
+ g_object_unref(context);
}