summaryrefslogtreecommitdiff
path: root/src/arch/processor.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-04-03 12:48:41 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-04-03 12:48:41 (GMT)
commitf80c4c6ee0479070f7319a5ce7e30e05406cdb8f (patch)
tree94bc363a6d1aeac29c1985a9627ceda962d1c38a /src/arch/processor.c
parent36a5b2577d67ab7c9f2c5817f6dba7a9601d1f20 (diff)
Reorganized the whole disassembling process and displayed the relative progression.
Diffstat (limited to 'src/arch/processor.c')
-rw-r--r--src/arch/processor.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/arch/processor.c b/src/arch/processor.c
index 21db869..da5ddce 100644
--- a/src/arch/processor.c
+++ b/src/arch/processor.c
@@ -520,6 +520,58 @@ GArchInstruction *g_arch_processor_get_disassembled_instructions(const GArchProc
/******************************************************************************
* *
+* Paramètres : proc = architecture visée par la procédure. *
+* index = indice de l'instruction visée. *
+* *
+* Description : Fournit une instruction désassemblée pour une architecture. *
+* *
+* Retour : Instructions désassemblée trouvée ou NULL si aucune. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GArchInstruction *g_arch_processor_get_disassembled_instruction(const GArchProcessor *proc, size_t index)
+{
+ GArchInstruction *result; /* Instruction à retourner */
+
+ if (proc->instr_count == 0)
+ result = NULL;
+
+ else
+ {
+ assert(index < proc->instr_count);
+
+ result = proc->instructions[index];
+
+ }
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : proc = architecture visée par la procédure. *
+* *
+* Description : Compte le nombre d'instructions représentées. *
+* *
+* Retour : Nombre d'instructions présentes. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+size_t g_arch_processor_count_disassembled_instructions(const GArchProcessor *proc)
+{
+ return proc->instr_count;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : proc = processeur recensant diverses instructions. *
* addr = position en mémoire ou physique à chercher. *
* nearby = la recherche s'effectue-t-elle de façon stricte ? *