diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-07-19 22:28:13 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-07-19 22:28:13 (GMT) |
commit | 59bda76b1a76d796a42ee46b9da7041dbef57253 (patch) | |
tree | 36f7d6eaa7847016b99431b1b489c6a1fdbaf33b /src/arch/instruction.c | |
parent | 3a9fe39c6a8923f45e7c96d80b0bfe52b8686ff9 (diff) |
Encapsulated all recognized variables in the stack using a new plugin (need to be continued).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@99 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r-- | src/arch/instruction.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index e0cea9f..37b2147 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -202,6 +202,25 @@ void g_arch_instruction_attach_extra_operand(GArchInstruction *instr, GArchOpera /****************************************************************************** * * +* Paramètres : instr = instance à consulter. * +* * +* Description : Indique la quantité d'opérandes présents dans l'instruction. * +* * +* Retour : Nombre d'opérandes attachés. * +* * +* Remarques : - * +* * +******************************************************************************/ + +size_t g_arch_instruction_count_operands(const GArchInstruction *instr) +{ + return instr->operands_count; + +} + + +/****************************************************************************** +* * * Paramètres : instr = instance à mettre à jour. * * index = indice de l'opérande concernée. * * * @@ -227,6 +246,34 @@ const GArchOperand *g_arch_instruction_get_operand(GArchInstruction *instr, size /****************************************************************************** * * +* Paramètres : instr = instance à mettre à jour. * +* new = nouvelle opérande à attacher. * +* old = ancienne opérande à détacher. * +* * +* Description : Replace un opérande d'une instruction par un autre. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_arch_instruction_replace_operand(GArchInstruction *instr, GArchOperand *new, const GArchOperand *old) +{ + size_t i; /* Boucle de parcours */ + + for (i = 0; i < instr->operands_count; i++) + if (instr->operands[i] == old) + break; + + if (i < instr->operands_count) + instr->operands[i] = new; + +} + + +/****************************************************************************** +* * * Paramètres : instr = instance à mettre à jour. * * opererand = instruction à venir dissocier. * * * |