diff options
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r-- | src/arch/instruction.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index b642219..dd43e14 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -306,9 +306,9 @@ size_t g_arch_instruction_count_operands(const GArchInstruction *instr) * * ******************************************************************************/ -const GArchOperand *g_arch_instruction_get_operand(GArchInstruction *instr, size_t index) +GArchOperand *g_arch_instruction_get_operand(const GArchInstruction *instr, size_t index) { - const GArchOperand *result; /* Opérande à retourner */ + GArchOperand *result; /* Opérande à retourner */ if (index >= instr->operands_count) result = NULL; else result = instr->operands[index]; @@ -463,6 +463,33 @@ bool g_arch_instruction_is_return(const GArchInstruction *instr) } +/****************************************************************************** +* * +* 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) +{ + GDecInstruction *result; /* Instruction à retourner */ + + if (instr->decomp != NULL) + result = instr->decomp(instr, ctx); + + else + result = NULL; + + return result; + +} + /* ---------------------------------------------------------------------------------- */ /* TRAITEMENT DES INSTRUCTIONS PAR ENSEMBLE */ |