summaryrefslogtreecommitdiff
path: root/src/arch/arm/v7
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm/v7')
-rw-r--r--src/arch/arm/v7/Makefile.am17
-rw-r--r--src/arch/arm/v7/instruction.c206
-rw-r--r--src/arch/arm/v7/instruction.h63
-rw-r--r--src/arch/arm/v7/processor.c173
-rw-r--r--src/arch/arm/v7/processor.h56
-rw-r--r--src/arch/arm/v7/register.c229
-rw-r--r--src/arch/arm/v7/register.h56
7 files changed, 800 insertions, 0 deletions
diff --git a/src/arch/arm/v7/Makefile.am b/src/arch/arm/v7/Makefile.am
new file mode 100644
index 0000000..1ac1c76
--- /dev/null
+++ b/src/arch/arm/v7/Makefile.am
@@ -0,0 +1,17 @@
+
+noinst_LTLIBRARIES = libarcharmv7.la
+
+libarcharmv7_la_SOURCES = \
+ instruction.h instruction.c \
+ processor.h processor.c \
+ register.h register.c
+
+libarcharmv7_la_CFLAGS = $(AM_CFLAGS)
+
+
+AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
+
+AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
+
+
+SUBDIRS = #opdefs
diff --git a/src/arch/arm/v7/instruction.c b/src/arch/arm/v7/instruction.c
new file mode 100644
index 0000000..0fc95c9
--- /dev/null
+++ b/src/arch/arm/v7/instruction.c
@@ -0,0 +1,206 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * instruction.c - gestion des instructions ARMv7
+ *
+ * Copyright (C) 2014 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "instruction.h"
+
+
+#include "../instruction-int.h"
+
+
+
+/* Définition d'une instruction d'architecture ARMv7 (instance) */
+struct _GArmV7Instruction
+{
+ GArmInstruction parent; /* Instance parente */
+
+ bool setflags; /* Mise à jour des drapeaux */
+
+};
+
+
+/* Définition d'une instruction d'architecture ARMv7 (classe) */
+struct _GArmV7InstructionClass
+{
+ GArmInstructionClass parent; /* Classe parente */
+
+};
+
+
+/* Initialise la classe des instructions ARMv7. */
+static void g_armv7_instruction_class_init(GArmV7InstructionClass *);
+
+/* Initialise une instance d'instruction ARMv7. */
+static void g_armv7_instruction_init(GArmV7Instruction *);
+
+/* Supprime toutes les références externes. */
+static void g_armv7_instruction_dispose(GArmV7Instruction *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_armv7_instruction_finalize(GArmV7Instruction *);
+
+
+
+/* Indique le type défini pour une représentation d'une instruction ARMv7. */
+G_DEFINE_TYPE(GArmV7Instruction, g_armv7_instruction, G_TYPE_ARM_INSTRUCTION);
+
+
+/******************************************************************************
+* *
+* Paramètres : klass = classe à initialiser. *
+* *
+* Description : Initialise la classe des instructions ARMv7. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_instruction_class_init(GArmV7InstructionClass *klass)
+{
+ GObjectClass *object_class; /* Autre version de la classe */
+
+ object_class = G_OBJECT_CLASS(klass);
+
+ object_class->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_instruction_dispose;
+ object_class->finalize = (GObjectFinalizeFunc)g_armv7_instruction_finalize;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : instr = instance à initialiser. *
+* *
+* Description : Initialise une instance d'instruction ARMv7. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_instruction_init(GArmV7Instruction *instr)
+{
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : instr = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_instruction_dispose(GArmV7Instruction *instr)
+{
+ G_OBJECT_CLASS(g_armv7_instruction_parent_class)->dispose(G_OBJECT(instr));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : instr = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_instruction_finalize(GArmV7Instruction *instr)
+{
+ G_OBJECT_CLASS(g_armv7_instruction_parent_class)->finalize(G_OBJECT(instr));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : - *
+* *
+* Description : Crée une instruction pour l'architecture ARMv7. *
+* *
+* Retour : Adresse de la structure mise en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GArmV7Instruction *g_armv7_instruction_new(void)
+{
+ GArmV7Instruction *result; /* Structure à retourner */
+
+ result = g_object_new(G_TYPE_ARMV7_INSTRUCTION, NULL);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : instr = instruction ARMv7 à mettre à jour. *
+* set = statut à enregistrer. *
+* *
+* Description : Définit si une instruction ARMv7 met à jour les drapeaux. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_armv7_instruction_define_setflags(GArmV7Instruction *instr, bool set)
+{
+ instr->setflags = set;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : instr = instruction ARMv7 à consulter. *
+* *
+* Description : Indique si une instruction ARMv7 met à jour les drapeaux. *
+* *
+* Retour : Statut des incidences de l'instruction. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool g_armv7_instruction_get_setflags(const GArmV7Instruction *instr)
+{
+ return instr->setflags;
+
+}
diff --git a/src/arch/arm/v7/instruction.h b/src/arch/arm/v7/instruction.h
new file mode 100644
index 0000000..0265911
--- /dev/null
+++ b/src/arch/arm/v7/instruction.h
@@ -0,0 +1,63 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * instruction.h - prototypes pour la gestion des instructions ARMv7
+ *
+ * Copyright (C) 2014 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _ARCH_ARM_V7_INSTRUCTION_H
+#define _ARCH_ARM_V7_INSTRUCTION_H
+
+
+#include <glib-object.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+
+
+#define G_TYPE_ARMV7_INSTRUCTION g_armv7_instruction_get_type()
+#define G_ARMV7_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_instruction_get_type(), GArmV7Instruction))
+#define G_IS_ARMV7_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_instruction_get_type()))
+#define G_ARMV7_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ARMV7_INSTRUCTION, GArmV7InstructionClass))
+#define G_IS_ARMV7_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ARMV7_INSTRUCTION))
+#define G_ARMV7_INSTRUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ARMV7_INSTRUCTION, GArmV7InstructionClass))
+
+
+/* Définition d'une instruction d'architecture ARMv7 (instance) */
+typedef struct _GArmV7Instruction GArmV7Instruction;
+
+/* Définition d'une instruction d'architecture ARMv7 (classe) */
+typedef struct _GArmV7InstructionClass GArmV7InstructionClass;
+
+
+/* Indique le type défini pour une représentation d'une instruction ARMv7. */
+GType g_armv7_instruction_get_type(void);
+
+/* Crée une instruction pour l'architecture ARMv7. */
+GArmV7Instruction *g_armv7_instruction_new(void);
+
+/* Définit si une instruction ARMv7 met à jour les drapeaux. */
+void g_armv7_instruction_define_setflags(GArmV7Instruction *, bool);
+
+/* Indique si une instruction ARMv7 met à jour les drapeaux. */
+bool g_armv7_instruction_get_setflags(const GArmV7Instruction *);
+
+
+
+#endif /* _ARCH_ARM_V7_INSTRUCTION_H */
diff --git a/src/arch/arm/v7/processor.c b/src/arch/arm/v7/processor.c
new file mode 100644
index 0000000..bcd44e9
--- /dev/null
+++ b/src/arch/arm/v7/processor.c
@@ -0,0 +1,173 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * processor.c - manipulation du processeur ARMv7
+ *
+ * Copyright (C) 2014 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "processor.h"
+
+
+#include "../processor-int.h"
+
+
+
+/* Définition du processeur ARMv7 (instance) */
+struct _GArmV7Processor
+{
+ GArmProcessor parent; /* Instance parente */
+
+};
+
+
+/* Définition du processeur ARMv7 (classe) */
+struct _GArmV7ProcessorClass
+{
+ GArmProcessorClass parent; /* Classe parente */
+
+};
+
+
+/* Initialise la classe des registres ARMv7. */
+static void g_armv7_processor_class_init(GArmV7ProcessorClass *);
+
+/* Initialise une instance de registre ARMv7. */
+static void g_armv7_processor_init(GArmV7Processor *);
+
+/* Supprime toutes les références externes. */
+static void g_armv7_processor_dispose(GArmV7Processor *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_armv7_processor_finalize(GArmV7Processor *);
+
+
+
+/* Indique le type défini par la GLib pour le processeur ARMv7. */
+G_DEFINE_TYPE(GArmV7Processor, g_armv7_processor, G_TYPE_ARM_PROCESSOR);
+
+
+/******************************************************************************
+* *
+* Paramètres : klass = classe à initialiser. *
+* *
+* Description : Initialise la classe des processeurs ARMv7. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_processor_class_init(GArmV7ProcessorClass *klass)
+{
+ GObjectClass *object_class; /* Autre version de la classe */
+
+ object_class = G_OBJECT_CLASS(klass);
+
+ object_class->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_processor_dispose;
+ object_class->finalize = (GObjectFinalizeFunc)g_armv7_processor_finalize;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : proc = instance à initialiser. *
+* *
+* Description : Initialise une instance de processeur ARMv7. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_processor_init(GArmV7Processor *proc)
+{
+
+ GArchProcessor *parent; /* Instance parente */
+
+ parent = G_ARCH_PROCESSOR(proc);
+
+ parent->endianness = SRE_LITTLE;
+ parent->memsize = MDS_32_BITS;
+ parent->inssize = MDS_32_BITS;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : proc = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_processor_dispose(GArmV7Processor *proc)
+{
+ G_OBJECT_CLASS(g_armv7_processor_parent_class)->dispose(G_OBJECT(proc));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : proc = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_processor_finalize(GArmV7Processor *proc)
+{
+ G_OBJECT_CLASS(g_armv7_processor_parent_class)->finalize(G_OBJECT(proc));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : - *
+* *
+* Description : Crée le support de l'architecture ARMv7. *
+* *
+* Retour : Adresse de la structure mise en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GArmV7Processor *g_armv7_processor_new(void)
+{
+ GArmV7Processor *result; /* Structure à retourner */
+
+ result = g_object_new(G_TYPE_ARMV7_PROCESSOR, NULL);
+
+ return result;
+
+}
diff --git a/src/arch/arm/v7/processor.h b/src/arch/arm/v7/processor.h
new file mode 100644
index 0000000..0361c55
--- /dev/null
+++ b/src/arch/arm/v7/processor.h
@@ -0,0 +1,56 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * processor.h - prototypes pour la manipulation du processeur ARMv7
+ *
+ * Copyright (C) 2014 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _ARCH_ARM_V7_PROCESSOR_H
+#define _ARCH_ARM_V7_PROCESSOR_H
+
+
+#include <glib-object.h>
+#include <stdint.h>
+
+
+
+#define G_TYPE_ARMV7_PROCESSOR g_armv7_processor_get_type()
+#define G_ARMV7_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_processor_get_type(), GArmV7Processor))
+#define G_IS_ARMV7_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_processor_get_type()))
+#define G_ARMV7_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ARMV7_PROCESSOR, GArmV7ProcessorClass))
+#define G_IS_ARMV7_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ARMV7_PROCESSOR))
+#define G_ARMV7_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ARMV7_PROCESSOR, GArmV7ProcessorClass))
+
+
+/* Définition du processeur ARMv7 (instance) */
+typedef struct _GArmV7Processor GArmV7Processor;
+
+/* Définition du processeur ARMv7 (classe) */
+typedef struct _GArmV7ProcessorClass GArmV7ProcessorClass;
+
+
+/* Indique le type défini par la GLib pour le processeur ARMv7. */
+GType g_armv7_processor_get_type(void);
+
+/* Crée le support de l'architecture ARMv7. */
+GArmV7Processor *g_armv7_processor_new(void);
+
+
+
+#endif /* _ARCH_ARM_V7_PROCESSOR_H */
diff --git a/src/arch/arm/v7/register.c b/src/arch/arm/v7/register.c
new file mode 100644
index 0000000..f9bb731
--- /dev/null
+++ b/src/arch/arm/v7/register.c
@@ -0,0 +1,229 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * registers.c - aides auxiliaires relatives aux registres ARMv7
+ *
+ * Copyright (C) 2014 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "register.h"
+
+
+#include <stdio.h>
+
+
+#include "../register-int.h"
+
+
+
+/* Représentation d'un registre ARMv7 (instance) */
+struct _GArmV7Register
+{
+ GArmRegister parent; /* Instance parente */
+
+};
+
+
+/* Représentation d'un registre ARMv7 (classe) */
+struct _GArmV7RegisterClass
+{
+ GArmRegisterClass parent; /* Classe parente */
+
+};
+
+
+#define MAX_REGNAME_LEN 8
+
+
+/* Initialise la classe des registres ARMv7. */
+static void g_armv7_register_class_init(GArmV7RegisterClass *);
+
+/* Initialise une instance de registre ARMv7. */
+static void g_armv7_register_init(GArmV7Register *);
+
+/* Supprime toutes les références externes. */
+static void g_armv7_register_dispose(GArmV7Register *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_armv7_register_finalize(GArmV7Register *);
+
+/* Traduit un registre en version humainement lisible. */
+static void g_armv7_register_print(const GArmV7Register *, GBufferLine *, AsmSyntax);
+
+
+
+/* Indique le type défini pour une représentation d'un registre ARMv7. */
+G_DEFINE_TYPE(GArmV7Register, g_armv7_register, G_TYPE_ARM_REGISTER);
+
+
+/******************************************************************************
+* *
+* Paramètres : klass = classe à initialiser. *
+* *
+* Description : Initialise la classe des registres ARMv7. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_register_class_init(GArmV7RegisterClass *klass)
+{
+ GObjectClass *object_class; /* Autre version de la classe */
+ GArchRegisterClass *reg_class; /* Classe de haut niveau */
+
+ object_class = G_OBJECT_CLASS(klass);
+ reg_class = G_ARCH_REGISTER_CLASS(klass);
+
+ object_class->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_register_dispose;
+ object_class->finalize = (GObjectFinalizeFunc)g_armv7_register_finalize;
+
+ reg_class->print = (reg_print_fc)g_armv7_register_print;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : reg = instance à initialiser. *
+* *
+* Description : Initialise une instance de registre ARMv7. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_register_init(GArmV7Register *reg)
+{
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : reg = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_register_dispose(GArmV7Register *reg)
+{
+ G_OBJECT_CLASS(g_armv7_register_parent_class)->dispose(G_OBJECT(reg));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : reg = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_register_finalize(GArmV7Register *reg)
+{
+ G_OBJECT_CLASS(g_armv7_register_parent_class)->finalize(G_OBJECT(reg));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : index = indice du registre correspondant. *
+* *
+* Description : Crée une réprésentation de registre ARMv7. *
+* *
+* Retour : Adresse de la structure mise en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GArmV7Register *g_armv7_register_new(uint8_t index)
+{
+ GArmV7Register *result; /* Structure à retourner */
+
+ result = g_object_new(G_TYPE_ARMV7_REGISTER, NULL);
+
+ G_ARM_REGISTER(result)->index = index;
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : reg = registre à transcrire. *
+* line = ligne tampon où imprimer l'opérande donné. *
+* syntax = type de représentation demandée. *
+* *
+* Description : Traduit un registre en version humainement lisible. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_armv7_register_print(const GArmV7Register *reg, GBufferLine *line, AsmSyntax syntax)
+{
+ char key[MAX_REGNAME_LEN]; /* Mot clef principal */
+ size_t klen; /* Taille de ce mot clef */
+
+ switch (G_ARM_REGISTER(reg)->index)
+ {
+ case 0 ... 12:
+ klen = snprintf(key, MAX_REGNAME_LEN, "r%hhu", G_ARM_REGISTER(reg)->index);
+ break;
+ case 13:
+ klen = snprintf(key, MAX_REGNAME_LEN, "sp");
+ break;
+ case 14:
+ klen = snprintf(key, MAX_REGNAME_LEN, "lr");
+ break;
+ case 15:
+ klen = snprintf(key, MAX_REGNAME_LEN, "pc");
+ break;
+ case 16:
+ klen = snprintf(key, MAX_REGNAME_LEN, "cpsr");
+ break;
+ case 17:
+ klen = snprintf(key, MAX_REGNAME_LEN, "spsr");
+ break;
+ default:
+ klen = snprintf(key, MAX_REGNAME_LEN, "r??");
+ break;
+ }
+
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY, key, klen, RTT_REGISTER);
+
+}
diff --git a/src/arch/arm/v7/register.h b/src/arch/arm/v7/register.h
new file mode 100644
index 0000000..ab71995
--- /dev/null
+++ b/src/arch/arm/v7/register.h
@@ -0,0 +1,56 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * registers.h - prototypes pour les aides auxiliaires relatives aux registres ARMv7
+ *
+ * Copyright (C) 2014 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _ARCH_ARM_V7_REGISTER_H
+#define _ARCH_ARM_V7_REGISTER_H
+
+
+#include <glib-object.h>
+#include <stdint.h>
+
+
+
+#define G_TYPE_ARMV7_REGISTER g_armv7_register_get_type()
+#define G_ARMV7_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_register_get_type(), GArmV7Register))
+#define G_IS_ARMV7_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_register_get_type()))
+#define G_ARMV7_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ARMV7_REGISTER, GArmV7RegisterClass))
+#define G_IS_ARMV7_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ARMV7_REGISTER))
+#define G_ARMV7_REGISTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ARMV7_REGISTER, GArmV7RegisterClass))
+
+
+/* Représentation d'un registre ARMv7 (instance) */
+typedef struct _GArmV7Register GArmV7Register;
+
+/* Représentation d'un registre ARMv7 (classe) */
+typedef struct _GArmV7RegisterClass GArmV7RegisterClass;
+
+
+/* Indique le type défini pour une représentation d'un registre ARMv7. */
+GType g_armv7_register_get_type(void);
+
+/* Crée une réprésentation de registre ARMv7. */
+GArmV7Register *g_armv7_register_new(uint8_t);
+
+
+
+#endif /* _ARCH_ARM_V7_REGISTER_H */