summaryrefslogtreecommitdiff
path: root/src/arch/instruction.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-05-11 23:42:48 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-05-11 23:42:48 (GMT)
commit96cb6971ee3ca529958b8cb1e8e55a6eb4e60eae (patch)
tree68e49f325de3e93ef186d3e078da8ddc473aedf7 /src/arch/instruction.h
parent80dc0ac97987ad9246bee7c47458a015339453bf (diff)
Reorganized the way the program is built again and added partial support for the JVM.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@63 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/instruction.h')
-rw-r--r--src/arch/instruction.h59
1 files changed, 55 insertions, 4 deletions
diff --git a/src/arch/instruction.h b/src/arch/instruction.h
index 6af865b..2df38af 100644
--- a/src/arch/instruction.h
+++ b/src/arch/instruction.h
@@ -35,11 +35,62 @@ typedef struct _asm_instr asm_instr;
-/* Crée une instruction de type 'db' à partir de données. */
-asm_instr *create_db_instruction(const uint8_t *, off_t *, off_t);
-/* Indique la position et/ou la taille d'une instruction. */
-void get_asm_instr_offset_and_length(const asm_instr *, off_t *, off_t *);
+
+
+#include <glib-object.h>
+#include <sys/types.h>
+
+
+#include "archbase.h"
+#include "operand.h"
+#include "../format/exe_format.h"
+
+
+
+/* Typage des instructions rencontrées */
+typedef enum _ArchInstructionType
+{
+ AIT_OTHER, /* Instruction inintéressante */
+
+ AIT_DB, /* Instruction non décodée */
+
+ AIT_PUSH, /* Empilement de valeur */
+ AIT_POP, /* Dépilement de valeur */
+ AIT_JUMP, /* Saut à une adresse */
+
+ AIT_CALL /* Appel d'une fonction */
+
+} ArchInstructionType;
+
+
+#define G_TYPE_ARCH_INSTRUCTION g_arch_instruction_get_type()
+#define G_ARCH_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_arch_instruction_get_type(), GArchInstruction))
+#define G_IS_ARCH_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_arch_instruction_get_type()))
+#define G_ARCH_INSTRUCTION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), g_arch_instruction_get_type(), GArchInstructionIface))
+
+
+/* Définition générique d'une instruction d'architecture (instance) */
+typedef struct _GArchInstruction GArchInstruction;
+
+/* Définition générique d'une instruction d'architecture (classe) */
+typedef struct _GArchInstructionClass GArchInstructionClass;
+
+
+/* Indique le type défini pour une instruction d'architecture. */
+GType g_arch_instruction_get_type(void);
+
+/* Définit la localisation d'une instruction. */
+void g_arch_instruction_set_location(GArchInstruction *, off_t, off_t, vmpa_t);
+
+/* Fournit la localisation d'une instruction. */
+void g_arch_instruction_get_location(GArchInstruction *, off_t *, off_t *, vmpa_t *);
+
+/* Attache une seule opérande à une instruction. */
+void g_arch_instruction_attach_one_operand(GArchInstruction *, GArchOperand *);
+
+/* Traduit une instruction en version humainement lisible. */
+char *g_arch_instruction_get_text(const GArchInstruction *, const exe_format *, AsmSyntax);