diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-11-11 01:22:43 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-11-11 01:22:43 (GMT) |
commit | b33a52031c0d44a79604bc8d9036c30bffd020cb (patch) | |
tree | c825e3330684ca57f7c423328cd116b2d6ec0f6a /src/analysis/routine.c | |
parent | 828124e38d266e382bb1477ef51c9fac8e81c591 (diff) |
Built some expressions for the decompilation tree.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@190 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/routine.c')
-rw-r--r-- | src/analysis/routine.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/src/analysis/routine.c b/src/analysis/routine.c index 0c8d83a..ad82407 100644 --- a/src/analysis/routine.c +++ b/src/analysis/routine.c @@ -55,6 +55,9 @@ struct _GBinRoutine GBinVariable **locals; /* Variables locales du code */ size_t locals_count; /* Nombre de variables locales */ + GArchInstruction *instr; /* Instructions natives */ + GDecInstruction *dinstr; /* Instructions décompilées */ + }; @@ -770,3 +773,87 @@ char *_g_binary_routine_to_string(const GBinRoutine *routine, Routine2StringOpti return result; } + + +/****************************************************************************** +* * +* Paramètres : routine = routine à consulter. * +* * +* Description : Fournit les instructions natives correspondantes. * +* * +* Retour : Ensemble d'instructions décompilées ou NULL. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GArchInstruction *g_binary_routine_get_instructions(const GBinRoutine *routine) +{ + return routine->instr; + +} + + +/****************************************************************************** +* * +* Paramètres : routine = routine à mettre à jour. * +* instr = série d'instructions à conserver. * +* * +* Description : Définit les instructions natives de la routine. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_binary_routine_set_instructions(GBinRoutine *routine, GArchInstruction *instr) +{ + if (routine->instr != NULL) + g_object_unref(G_OBJECT(routine->instr)); + + routine->instr = instr; + +} + + +/****************************************************************************** +* * +* Paramètres : routine = routine à consulter. * +* * +* Description : Fournit les instructions décompilées correspondantes. * +* * +* Retour : Ensemble d'instructions décompilées ou NULL. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GDecInstruction *g_binary_routine_get_decomp_instructions(const GBinRoutine *routine) +{ + return routine->dinstr; + +} + + +/****************************************************************************** +* * +* Paramètres : routine = routine à mettre à jour. * +* instr = série d'instructions à conserver. * +* * +* Description : Définit les instructions décompilées de la routine. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_binary_routine_set_decomp_instructions(GBinRoutine *routine, GDecInstruction *instr) +{ + if (routine->dinstr != NULL) + g_object_unref(G_OBJECT(routine->dinstr)); + + routine->dinstr = instr; + +} |