summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-11-26 20:41:55 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-11-26 20:41:55 (GMT)
commit903006678160f620b947d5fbce2a8e257a357d77 (patch)
tree2ad234f63cbd7eb38aac0891571fefa9874a3d7f /src/arch
parent1252efcd18a845a7c2641354838c26ece3d6d873 (diff)
Removed the broken support of the x86 architecture.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/Makefile.am22
-rw-r--r--src/arch/x86/instruction.c823
-rw-r--r--src/arch/x86/instruction.h425
-rw-r--r--src/arch/x86/opcodes/Makefile.am55
-rw-r--r--src/arch/x86/opcodes/adc.c161
-rw-r--r--src/arch/x86/opcodes/add.c340
-rw-r--r--src/arch/x86/opcodes/and.c271
-rw-r--r--src/arch/x86/opcodes/arpl.c61
-rw-r--r--src/arch/x86/opcodes/call.c100
-rw-r--r--src/arch/x86/opcodes/cld.c56
-rw-r--r--src/arch/x86/opcodes/cmp.c340
-rw-r--r--src/arch/x86/opcodes/cmps.c64
-rw-r--r--src/arch/x86/opcodes/dec.c137
-rw-r--r--src/arch/x86/opcodes/hlt.c56
-rw-r--r--src/arch/x86/opcodes/inc.c137
-rw-r--r--src/arch/x86/opcodes/int.c93
-rw-r--r--src/arch/x86/opcodes/jump.c1238
-rw-r--r--src/arch/x86/opcodes/lea.c64
-rw-r--r--src/arch/x86/opcodes/leave.c56
-rw-r--r--src/arch/x86/opcodes/mov.c410
-rw-r--r--src/arch/x86/opcodes/movs.c64
-rw-r--r--src/arch/x86/opcodes/movsx.c100
-rw-r--r--src/arch/x86/opcodes/movzx.c100
-rw-r--r--src/arch/x86/opcodes/mul.c137
-rw-r--r--src/arch/x86/opcodes/nop.c56
-rw-r--r--src/arch/x86/opcodes/not.c97
-rw-r--r--src/arch/x86/opcodes/opcodes.h685
-rw-r--r--src/arch/x86/opcodes/or.c304
-rw-r--r--src/arch/x86/opcodes/pop.c95
-rw-r--r--src/arch/x86/opcodes/push.c141
-rw-r--r--src/arch/x86/opcodes/rcl.c235
-rw-r--r--src/arch/x86/opcodes/rcr.c235
-rw-r--r--src/arch/x86/opcodes/ret.c152
-rw-r--r--src/arch/x86/opcodes/rol.c235
-rw-r--r--src/arch/x86/opcodes/ror.c235
-rw-r--r--src/arch/x86/opcodes/sar.c235
-rw-r--r--src/arch/x86/opcodes/sbb.c169
-rw-r--r--src/arch/x86/opcodes/scas.c61
-rw-r--r--src/arch/x86/opcodes/set.c556
-rw-r--r--src/arch/x86/opcodes/shl.c235
-rw-r--r--src/arch/x86/opcodes/shr.c235
-rw-r--r--src/arch/x86/opcodes/stos.c64
-rw-r--r--src/arch/x86/opcodes/sub.c307
-rw-r--r--src/arch/x86/opcodes/test.c235
-rw-r--r--src/arch/x86/opcodes/xchg.c67
-rw-r--r--src/arch/x86/opcodes/xor.c340
-rw-r--r--src/arch/x86/operand.c234
-rw-r--r--src/arch/x86/operand.h100
-rw-r--r--src/arch/x86/operands/Makefile.am19
-rw-r--r--src/arch/x86/operands/data.c197
-rw-r--r--src/arch/x86/operands/data.h60
-rw-r--r--src/arch/x86/operands/modrm.c430
-rw-r--r--src/arch/x86/operands/modrm.h70
-rw-r--r--src/arch/x86/operands/moffs.c180
-rw-r--r--src/arch/x86/operands/moffs.h59
-rw-r--r--src/arch/x86/operands/register.c263
-rw-r--r--src/arch/x86/operands/register.h66
-rw-r--r--src/arch/x86/operands/relative.c211
-rw-r--r--src/arch/x86/operands/relative.h63
-rw-r--r--src/arch/x86/processor.c531
-rw-r--r--src/arch/x86/processor.h57
-rw-r--r--src/arch/x86/register.c627
-rw-r--r--src/arch/x86/register.h72
63 files changed, 0 insertions, 13523 deletions
diff --git a/src/arch/x86/Makefile.am b/src/arch/x86/Makefile.am
deleted file mode 100644
index 1a41e72..0000000
--- a/src/arch/x86/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-
-noinst_LTLIBRARIES = libarchx86.la
-
-libarchx86_la_SOURCES = \
- instruction.h instruction.c \
- operand.h operand.c \
- processor.h processor.c \
- register.h register.c
-
-libarchx86_la_LIBADD = \
- opcodes/libarchx86opcodes.la \
- operands/libarchx86operands.la
-
-libarchx86_la_CFLAGS = $(AM_CFLAGS)
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-
-
-SUBDIRS = opcodes operands
diff --git a/src/arch/x86/instruction.c b/src/arch/x86/instruction.c
deleted file mode 100644
index 4023a7f..0000000
--- a/src/arch/x86/instruction.c
+++ /dev/null
@@ -1,823 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * instruction.c - gestion des instructions de l'architecture x86
- *
- * Copyright (C) 2009-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 <string.h>
-
-
-#include "operand.h"
-#include "../instruction-int.h"
-#include "../../common/extstr.h"
-
-
-
-/* Définition générique d'une instruction d'architecture x86 (instance) */
-struct _GX86Instruction
-{
- GArchInstruction parent; /* A laisser en premier */
-
- X86Opcodes type; /* Position dans la liste */
-
- X86Prefix prefixes; /* Préfixes finalement trouvés */
-
- char *cached_text; /* Nom construit à conserver */
-
-};
-
-/* Définition générique d'une instruction d'architecture x86 (classe) */
-struct _GX86InstructionClass
-{
- GArchInstructionClass parent; /* A laisser en premier */
-
-};
-
-
-/* Initialise la classe des instructions pour x86. */
-static void g_x86_instruction_class_init(GX86InstructionClass *);
-
-/* Initialise une instance d'opérande d'architecture x86. */
-static void g_x86_instruction_init(GX86Instruction *);
-
-
-
-/* --------------------- AIDE A LA MISE EN PLACE D'INSTRUCTIONS --------------------- */
-
-
-/* Répertoire de toutes les instructions x86 */
-typedef struct _x86_instruction
-{
- bool care_of_data; /* Devinette = repas ? */
- bin_t opcode; /* Opcode de l'instruction */
- bin_t op_extension; /* Extension de l'opcode */
-
- const char *keyword; /* Mot clef de la commande */
-
- X86Prefix prefix; /* Eventuel(s) préfixe(s) */
-
-} x86_instruction;
-
-
-#define OPCODE_EXT(eop) ((eop) & 0x38)
-#define IDX_TO_EXT(idx) (idx == -1 ? 0xff : idx << 3)
-
-
-static x86_instruction _instructions[XOP_COUNT] = {
-
- /* Instructions avec opcode sur un octet */
-
- [XOP_ADD_RM8_R8] = { false, 0x00, IDX_TO_EXT(-1), "add", XPX_NONE },
- [XOP_ADD_RM1632_R1632] = { false, 0x01, IDX_TO_EXT(-1), "add", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ADD_R8_RM8] = { false, 0x02, IDX_TO_EXT(-1), "add", XPX_NONE },
- [XOP_ADD_R1632_RM1632] = { false, 0x03, IDX_TO_EXT(-1), "add", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ADD_AL_IMM8] = { false, 0x04, IDX_TO_EXT(-1), "add", XPX_NONE },
- [XOP_ADD_E_AX_IMM1632] = { false, 0x05, IDX_TO_EXT(-1), "add", XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_OR_RM8_R8] = { false, 0x08, IDX_TO_EXT(-1), "or", XPX_NONE },
- [XOP_OR_RM1632_R1632] = { false, 0x09, IDX_TO_EXT(-1), "or", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_OR_R8_RM8] = { false, 0x0a, IDX_TO_EXT(-1), "or", XPX_NONE },
- [XOP_OR_R1632_RM1632] = { false, 0x0b, IDX_TO_EXT(-1), "or", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_OR_AL_IMM8] = { false, 0x0c, IDX_TO_EXT(-1), "or", XPX_NONE },
-
-
-
- [XOP_ADC_RM8_R8] = { false, 0x10, IDX_TO_EXT(-1), "adc", XPX_NONE },
-
- [XOP_SBB_RM1632_R1632] = { false, 0x19, IDX_TO_EXT(-1), "sbb", XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_AND_RM8_R8] = { false, 0x20, IDX_TO_EXT(-1), "and", XPX_NONE },
- [XOP_AND_RM1632_R1632] = { false, 0x21, IDX_TO_EXT(-1), "and", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_AND_AL_IMM8] = { false, 0x24, IDX_TO_EXT(-1), "and", XPX_NONE },
- [XOP_AND_E_AX_IMM1632] = { false, 0x25, IDX_TO_EXT(-1), "and", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_SUB_RM1632_R1632] = { false, 0x29, IDX_TO_EXT(-1), "sub", XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_SUB_R8_RM8] = { false, 0x2a, IDX_TO_EXT(-1), "sub", XPX_NONE },
- [XOP_SUB_R1632_RM1632] = { false, 0x2b, IDX_TO_EXT(-1), "sub", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SUB_AL_IMM8] = { false, 0x2c, IDX_TO_EXT(-1), "sub", XPX_NONE },
-
- [XOP_SUB_E_AX_IMM1632] = { false, 0x2d, IDX_TO_EXT(-1), "sub", XPX_OPERAND_SIZE_OVERRIDE },
-
-
-
- [XOP_XOR_RM8_R8] = { false, 0x30, IDX_TO_EXT(-1), "xor", XPX_NONE},
- [XOP_XOR_RM1632_R1632] = { false, 0x31, IDX_TO_EXT(-1), "xor", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XOR_R8_RM8] = { false, 0x32, IDX_TO_EXT(-1), "xor", XPX_NONE},
- [XOP_XOR_R1632_RM1632] = { false, 0x33, IDX_TO_EXT(-1), "xor", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XOR_AL_IMM8] = { false, 0x34, IDX_TO_EXT(-1), "xor", XPX_NONE },
- [XOP_XOR_E_AX_IMM1632] = { false, 0x35, IDX_TO_EXT(-1), "xor", XPX_OPERAND_SIZE_OVERRIDE },
-
-
-
-
-
- [XOP_CMP_RM8_R8] = { false, 0x38, IDX_TO_EXT(-1), "cmp", XPX_NONE },
- [XOP_CMP_RM1632_R1632] = { false, 0x39, IDX_TO_EXT(-1), "cmp", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_CMP_R8_RM8] = { false, 0x3a, IDX_TO_EXT(-1), "cmp", XPX_NONE },
- [XOP_CMP_R1632_RM1632] = { false, 0x3b, IDX_TO_EXT(-1), "cmp", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_CMP_AL_IMM8] = { false, 0x3c, IDX_TO_EXT(-1), "cmp", XPX_NONE },
- [XOP_CMP_E_AX_IMM1632] = { false, 0x3d, IDX_TO_EXT(-1), "cmp", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_INC_E_AX] = { true, 0x40, IDX_TO_EXT(-1), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_INC_E_CX] = { true, 0x41, IDX_TO_EXT(-1), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_INC_E_DX] = { true, 0x42, IDX_TO_EXT(-1), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_INC_E_BX] = { true, 0x43, IDX_TO_EXT(-1), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_INC_E_SP] = { true, 0x44, IDX_TO_EXT(-1), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_INC_E_BP] = { true, 0x45, IDX_TO_EXT(-1), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_INC_E_SI] = { true, 0x46, IDX_TO_EXT(-1), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_INC_E_DI] = { true, 0x47, IDX_TO_EXT(-1), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_E_AX] = { true, 0x48, IDX_TO_EXT(-1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_E_CX] = { true, 0x49, IDX_TO_EXT(-1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_E_DX] = { true, 0x4a, IDX_TO_EXT(-1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_E_BX] = { true, 0x4b, IDX_TO_EXT(-1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_E_SP] = { true, 0x4c, IDX_TO_EXT(-1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_E_BP] = { true, 0x4d, IDX_TO_EXT(-1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_E_SI] = { true, 0x4e, IDX_TO_EXT(-1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_E_DI] = { true, 0x4f, IDX_TO_EXT(-1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_E_AX] = { true, 0x50, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_E_CX] = { true, 0x51, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_E_DX] = { true, 0x52, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_E_BX] = { true, 0x53, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_E_SP] = { true, 0x54, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_E_BP] = { true, 0x55, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_E_SI] = { true, 0x56, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_E_DI] = { true, 0x57, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_POP_E_AX] = { true, 0x58, IDX_TO_EXT(-1), "pop", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_POP_E_CX] = { true, 0x59, IDX_TO_EXT(-1), "pop", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_POP_E_DX] = { true, 0x5a, IDX_TO_EXT(-1), "pop", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_POP_E_BX] = { true, 0x5b, IDX_TO_EXT(-1), "pop", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_POP_E_SP] = { true, 0x5c, IDX_TO_EXT(-1), "pop", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_POP_E_BP] = { true, 0x5d, IDX_TO_EXT(-1), "pop", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_POP_E_SI] = { true, 0x5e, IDX_TO_EXT(-1), "pop", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_POP_E_DI] = { true, 0x5f, IDX_TO_EXT(-1), "pop", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_POPA] = { false, 0x61, IDX_TO_EXT(-1), "popa", XPX_NONE },
-
- [XOP_ARPL_RM16_R16] = { false, 0x63, IDX_TO_EXT(-1), "arpl", XPX_NONE },
-
- [XOP_PUSH_IMM1632] = { false, 0x68, IDX_TO_EXT(-1), "push", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_IMUL_R1632_RM1632_IMM1632] = { false, 0x69, IDX_TO_EXT(-1), "imul", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_IMUL_RM1632_IMM8] = { false, 0x6b, IDX_TO_EXT(-1), "imul", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_JO_REL8] = { false, 0x70, IDX_TO_EXT(-1), "jo", XPX_NONE },
- [XOP_JNO_REL8] = { false, 0x71, IDX_TO_EXT(-1), "jno", XPX_NONE },
- [XOP_JB_REL8] = { false, 0x72, IDX_TO_EXT(-1), "jb", XPX_NONE },
- [XOP_JNB_REL8] = { false, 0x73, IDX_TO_EXT(-1), "jnb", XPX_NONE },
- [XOP_JE_REL8] = { false, 0x74, IDX_TO_EXT(-1), "je", XPX_NONE },
- [XOP_JNE_REL8] = { false, 0x75, IDX_TO_EXT(-1), "jne", XPX_NONE },
- [XOP_JNA_REL8] = { false, 0x76, IDX_TO_EXT(-1), "jna", XPX_NONE },
- [XOP_JA_REL8] = { false, 0x77, IDX_TO_EXT(-1), "ja", XPX_NONE },
- [XOP_JS_REL8] = { false, 0x78, IDX_TO_EXT(-1), "js", XPX_NONE },
- [XOP_JNS_REL8] = { false, 0x79, IDX_TO_EXT(-1), "jns", XPX_NONE },
- [XOP_JP_REL8] = { false, 0x7a, IDX_TO_EXT(-1), "jp", XPX_NONE },
- [XOP_JNP_REL8] = { false, 0x7b, IDX_TO_EXT(-1), "jnp", XPX_NONE },
- [XOP_JL_REL8] = { false, 0x7c, IDX_TO_EXT(-1), "jl", XPX_NONE },
- [XOP_JNL_REL8] = { false, 0x7d, IDX_TO_EXT(-1), "jnl", XPX_NONE },
- [XOP_JNG_REL8] = { false, 0x7e, IDX_TO_EXT(-1), "jng", XPX_NONE },
- [XOP_JG_REL8] = { false, 0x7f, IDX_TO_EXT(-1), "jg", XPX_NONE },
- [XOP_ADD_RM8_IMM8] = { false, 0x80, IDX_TO_EXT(0), "add", XPX_NONE },
- [XOP_OR_RM8_IMM8] = { false, 0x80, IDX_TO_EXT(1), "or", XPX_NONE },
- [XOP_ADC_RM8_IMM8] = { false, 0x80, IDX_TO_EXT(2), "adc", XPX_NONE },
- [XOP_SBB_RM8_IMM8] = { false, 0x80, IDX_TO_EXT(3), "sbb", XPX_NONE },
- [XOP_AND_RM8_IMM8] = { false, 0x80, IDX_TO_EXT(4), "and", XPX_NONE },
- [XOP_SUB_RM8_IMM8] = { false, 0x80, IDX_TO_EXT(5), "sub", XPX_NONE },
- [XOP_XOR_RM8_IMM8] = { false, 0x80, IDX_TO_EXT(6), "xor", XPX_NONE },
- [XOP_CMP_RM8_IMM8] = { false, 0x80, IDX_TO_EXT(7), "cmp", XPX_NONE },
- [XOP_ADD_RM1632_IMM1632] = { false, 0x81, IDX_TO_EXT(0), "add", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_OR_RM1632_IMM1632] = { false, 0x81, IDX_TO_EXT(0), "add", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ADC_RM1632_IMM1632] = { false, 0x81, IDX_TO_EXT(2), "adc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SBB_RM1632_IMM1632] = { false, 0x81, IDX_TO_EXT(3), "sbb", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_AND_RM1632_IMM1632] = { false, 0x81, IDX_TO_EXT(4), "and", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SUB_RM1632_IMM1632] = { false, 0x81, IDX_TO_EXT(5), "sub", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XOR_RM1632_IMM1632] = { false, 0x81, IDX_TO_EXT(6), "xor", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_CMP_RM1632_IMM1632] = { false, 0x81, IDX_TO_EXT(7), "cmp", XPX_OPERAND_SIZE_OVERRIDE },
-
-
-
- [XOP_ADD_RM1632_IMM8] = { false, 0x83, IDX_TO_EXT(0), "add", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_OR_RM1632_IMM8] = { false, 0x83, IDX_TO_EXT(1), "or", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ADC_RM1632_IMM8] = { false, 0x83, IDX_TO_EXT(2), "adc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SBB_RM1632_IMM8] = { false, 0x83, IDX_TO_EXT(3), "sbb", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_AND_RM1632_IMM8] = { false, 0x83, IDX_TO_EXT(4), "and", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SUB_RM1632_IMM8] = { false, 0x83, IDX_TO_EXT(5), "sub", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XOR_RM1632_IMM8] = { false, 0x83, IDX_TO_EXT(6), "xor", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_CMP_RM1632_IMM8] = { false, 0x83, IDX_TO_EXT(7), "cmp", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_TEST_RM8_R8] = { false, 0x84, IDX_TO_EXT(-1), "test", XPX_NONE },
- [XOP_TEST_RM1632_R1632] = { false, 0x85, IDX_TO_EXT(-1), "test", XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_MOV_RM8_R8] = { false, 0x88, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_RM1632_R1632] = { false, 0x89, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_MOV_R1632_RM1632] = { false, 0x8b, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_LEA_R1632_M] = { false, 0x8d, IDX_TO_EXT(-1), "lea", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_NOP] = { false, 0x90, IDX_TO_EXT(-1), "nop", XPX_NONE },
- [XOP_XCHG_R1632_E_AX] = { true, 0x90, IDX_TO_EXT(-1), "xchg", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XCHG_R1632_E_CX] = { true, 0x91, IDX_TO_EXT(-1), "xchg", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XCHG_R1632_E_DX] = { true, 0x92, IDX_TO_EXT(-1), "xchg", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XCHG_R1632_E_BX] = { true, 0x93, IDX_TO_EXT(-1), "xchg", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XCHG_R1632_E_SP] = { true, 0x94, IDX_TO_EXT(-1), "xchg", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XCHG_R1632_E_BP] = { true, 0x95, IDX_TO_EXT(-1), "xchg", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XCHG_R1632_E_SI] = { true, 0x96, IDX_TO_EXT(-1), "xchg", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_XCHG_R1632_E_DI] = { true, 0x97, IDX_TO_EXT(-1), "xchg", XPX_OPERAND_SIZE_OVERRIDE },
-
-
-
- [XOP_MOV_AL_MOFFS8] = { false, 0xa0, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_E_AX_MOFFS1632] = { false, 0xa1, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOV_MOFFS8_AL] = { false, 0xa2, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_MOFFS1632_E_AX] = { false, 0xa3, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_MOVS_M1632_M1632] = { false, 0xa5, IDX_TO_EXT(-1), "movs", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_CMPS_M8_M8] = { false, 0xa6, IDX_TO_EXT(-1), "cmps", XPX_NONE },
-
- [XOP_TEST_AL_IMM8] = { false, 0xa8, IDX_TO_EXT(-1), "test", XPX_NONE },
- [XOP_TEST_E_AX_IMM1632] = { false, 0xa9, IDX_TO_EXT(-1), "test", XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_STOS_M1632_E_AX] = { false, 0xab, IDX_TO_EXT(-1), "stos", XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_SCAS_AL_M8] = { false, 0xae, IDX_TO_EXT(-1), "scas", XPX_NONE },
-
-
- [XOP_MOV_AL_IMM8] = { true, 0xb0, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_CL_IMM8] = { true, 0xb1, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_DL_IMM8] = { true, 0xb2, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_BL_IMM8] = { true, 0xb3, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_AH_IMM8] = { true, 0xb4, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_CH_IMM8] = { true, 0xb5, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_DH_IMM8] = { true, 0xb6, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_BH_IMM8] = { true, 0xb7, IDX_TO_EXT(-1), "mov", XPX_NONE },
- [XOP_MOV_E_AX_IMM1632] = { true, 0xb8, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOV_E_CX_IMM1632] = { true, 0xb9, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOV_E_DX_IMM1632] = { true, 0xba, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOV_E_BX_IMM1632] = { true, 0xbb, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOV_E_SP_IMM1632] = { true, 0xbc, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOV_E_BP_IMM1632] = { true, 0xbd, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOV_E_SI_IMM1632] = { true, 0xbe, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOV_E_DI_IMM1632] = { true, 0xbf, IDX_TO_EXT(-1), "mov", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ROL_RM8_IMM8] = { false, 0xc0, IDX_TO_EXT(0), "rol", XPX_NONE },
- [XOP_ROR_RM8_IMM8] = { false, 0xc0, IDX_TO_EXT(1), "ror", XPX_NONE },
- [XOP_RCL_RM8_IMM8] = { false, 0xc0, IDX_TO_EXT(2), "rcl", XPX_NONE },
- [XOP_RCR_RM8_IMM8] = { false, 0xc0, IDX_TO_EXT(3), "rcr", XPX_NONE },
- [XOP_SHL_RM8_IMM8] = { false, 0xc0, IDX_TO_EXT(4), "shl", XPX_NONE },
- [XOP_SHR_RM8_IMM8] = { false, 0xc0, IDX_TO_EXT(5), "shr", XPX_NONE },
- [XOP_SAL_RM8_IMM8] = { false, 0xc0, IDX_TO_EXT(6), "sal", XPX_NONE },
- [XOP_SAR_RM8_IMM8] = { false, 0xc0, IDX_TO_EXT(7), "sar", XPX_NONE },
- [XOP_ROL_RM1632_IMM8] = { false, 0xc1, IDX_TO_EXT(0), "rol", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ROR_RM1632_IMM8] = { false, 0xc1, IDX_TO_EXT(1), "ror", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_RCL_RM1632_IMM8] = { false, 0xc1, IDX_TO_EXT(2), "rcl", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_RCR_RM1632_IMM8] = { false, 0xc1, IDX_TO_EXT(3), "rcr", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SHL_RM1632_IMM8] = { false, 0xc1, IDX_TO_EXT(4), "shl", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SHR_RM1632_IMM8] = { false, 0xc1, IDX_TO_EXT(5), "shr", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SAL_RM1632_IMM8] = { false, 0xc1, IDX_TO_EXT(6), "sal", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SAR_RM1632_IMM8] = { false, 0xc1, IDX_TO_EXT(7), "sar", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_RETN_IMM16] = { false, 0xc2, IDX_TO_EXT(-1), "retn", XPX_NONE },
- [XOP_RETN] = { false, 0xc3, IDX_TO_EXT(-1), "ret", XPX_NONE },
-
-
- [XOP_MOV_RM8_IMM8] = { false, 0xc6, IDX_TO_EXT(0), "mov", XPX_NONE },
- [XOP_MOV_RM1632_IMM1632] = { false, 0xc7, IDX_TO_EXT(0), "mov", XPX_OPERAND_SIZE_OVERRIDE },
-
-
-
- [XOP_LEAVE] = { false, 0xc9, IDX_TO_EXT(-1), "leave", XPX_NONE },
- [XOP_RETF_IMM16] = { false, 0xca, IDX_TO_EXT(-1), "retf", XPX_NONE },
- [XOP_RETF] = { false, 0xcb, IDX_TO_EXT(-1), "ret", XPX_NONE },
- [XOP_INT_3] = { false, 0xcc, IDX_TO_EXT(-1), "int", XPX_NONE },
- [XOP_INT] = { false, 0xcd, IDX_TO_EXT(-1), "int", XPX_NONE },
-
-
- [XOP_ROL_RM8_1] = { false, 0xd0, IDX_TO_EXT(0), "rol", XPX_NONE },
- [XOP_ROR_RM8_1] = { false, 0xd0, IDX_TO_EXT(1), "ror", XPX_NONE },
- [XOP_RCL_RM8_1] = { false, 0xd0, IDX_TO_EXT(2), "rcl", XPX_NONE },
- [XOP_RCR_RM8_1] = { false, 0xd0, IDX_TO_EXT(3), "rcr", XPX_NONE },
- [XOP_SHL_RM8_1] = { false, 0xd0, IDX_TO_EXT(4), "shl", XPX_NONE },
- [XOP_SHR_RM8_1] = { false, 0xd0, IDX_TO_EXT(5), "shr", XPX_NONE },
- [XOP_SAL_RM8_1] = { false, 0xd0, IDX_TO_EXT(6), "sal", XPX_NONE },
- [XOP_SAR_RM8_1] = { false, 0xd0, IDX_TO_EXT(7), "sar", XPX_NONE },
- [XOP_ROL_RM1632_1] = { false, 0xd1, IDX_TO_EXT(0), "rol", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ROR_RM1632_1] = { false, 0xd1, IDX_TO_EXT(1), "ror", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_RCL_RM1632_1] = { false, 0xd1, IDX_TO_EXT(2), "rcl", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_RCR_RM1632_1] = { false, 0xd1, IDX_TO_EXT(3), "rcr", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SHL_RM1632_1] = { false, 0xd1, IDX_TO_EXT(4), "shl", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SHR_RM1632_1] = { false, 0xd1, IDX_TO_EXT(5), "shr", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SAL_RM1632_1] = { false, 0xd1, IDX_TO_EXT(6), "sal", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SAR_RM1632_1] = { false, 0xd1, IDX_TO_EXT(7), "sar", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ROL_RM8_CL] = { false, 0xd2, IDX_TO_EXT(0), "rol", XPX_NONE },
- [XOP_ROR_RM8_CL] = { false, 0xd2, IDX_TO_EXT(1), "ror", XPX_NONE },
- [XOP_RCL_RM8_CL] = { false, 0xd2, IDX_TO_EXT(2), "rcl", XPX_NONE },
- [XOP_RCR_RM8_CL] = { false, 0xd2, IDX_TO_EXT(3), "rcr", XPX_NONE },
- [XOP_SHL_RM8_CL] = { false, 0xd2, IDX_TO_EXT(4), "shl", XPX_NONE },
- [XOP_SHR_RM8_CL] = { false, 0xd2, IDX_TO_EXT(5), "shr", XPX_NONE },
- [XOP_SAL_RM8_CL] = { false, 0xd2, IDX_TO_EXT(6), "sal", XPX_NONE },
- [XOP_SAR_RM8_CL] = { false, 0xd2, IDX_TO_EXT(7), "sar", XPX_NONE },
- [XOP_ROL_RM1632_CL] = { false, 0xd3, IDX_TO_EXT(0), "rol", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_ROR_RM1632_CL] = { false, 0xd3, IDX_TO_EXT(1), "ror", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_RCL_RM1632_CL] = { false, 0xd3, IDX_TO_EXT(2), "rcl", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_RCR_RM1632_CL] = { false, 0xd3, IDX_TO_EXT(3), "rcr", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SHL_RM1632_CL] = { false, 0xd3, IDX_TO_EXT(4), "shl", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SHR_RM1632_CL] = { false, 0xd3, IDX_TO_EXT(5), "shr", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SAL_RM1632_CL] = { false, 0xd3, IDX_TO_EXT(6), "sal", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SAR_RM1632_CL] = { false, 0xd3, IDX_TO_EXT(7), "sar", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_CALL_REL1632] = { false, 0xe8, IDX_TO_EXT(-1), "call", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JMP_REL1632] = { false, 0xe9, IDX_TO_EXT(-1), "jmp", XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_JMP_REL8] = { false, 0xeb, IDX_TO_EXT(-1), "jmp", XPX_NONE },
-
- [XOP_HLT] = { false, 0xf4, IDX_TO_EXT(-1), "hlt", XPX_NONE },
-
- [XOP_TEST_RM8_IMM8] = { false, 0xf6, IDX_TO_EXT(0), "test", XPX_NONE },
- [XOP_TEST_RM8_IMM8_BIS] = { false, 0xf6, IDX_TO_EXT(1), "test", XPX_NONE },
- [XOP_NOT_RM8] = { false, 0xf6, IDX_TO_EXT(2), "not", XPX_NONE },
-
- [XOP_TEST_RM1632_IMM1632] = { false, 0xf7, IDX_TO_EXT(0), "test", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_TEST_RM1632_IMM1632_BIS] = { false, 0xf7, IDX_TO_EXT(1), "test", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_NOT_RM1632] = { false, 0xf7, IDX_TO_EXT(2), "not", XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_IMUL_RM1632] = { false, 0xf7, IDX_TO_EXT(5), "imul", XPX_OPERAND_SIZE_OVERRIDE },
-
-
- [XOP_CLD] = { false, 0xfc, IDX_TO_EXT(-1), "cld", XPX_NONE },
-
-
- [XOP_INC_RM8] = { false, 0xfe, IDX_TO_EXT(0), "inc", XPX_NONE },
- [XOP_DEC_RM8] = { false, 0xfe, IDX_TO_EXT(1), "dec", XPX_NONE },
- [XOP_INC_RM1632] = { false, 0xff, IDX_TO_EXT(0), "inc", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_DEC_RM1632] = { false, 0xff, IDX_TO_EXT(1), "dec", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_CALL_RM1632] = { false, 0xff, IDX_TO_EXT(2), "call", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JMP_RM1632] = { false, 0xff, IDX_TO_EXT(4), "jmp", XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_PUSH_RM1632] = { false, 0xff, IDX_TO_EXT(6), "push", XPX_OPERAND_SIZE_OVERRIDE },
-
-
-
-
-
-
- /* Instructions avec opcode sur deux octets */
-
- [XOP_JO_REL1632] = { false, 0x80, IDX_TO_EXT(-1), "jo", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JNO_REL1632] = { false, 0x81, IDX_TO_EXT(-1), "jno", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JB_REL1632] = { false, 0x82, IDX_TO_EXT(-1), "jb", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JNB_REL1632] = { false, 0x83, IDX_TO_EXT(-1), "jnb", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JE_REL1632] = { false, 0x84, IDX_TO_EXT(-1), "je", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JNE_REL1632] = { false, 0x85, IDX_TO_EXT(-1), "jne", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JNA_REL1632] = { false, 0x86, IDX_TO_EXT(-1), "jna", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JA_REL1632] = { false, 0x87, IDX_TO_EXT(-1), "ja", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JS_REL1632] = { false, 0x88, IDX_TO_EXT(-1), "js", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JNS_REL1632] = { false, 0x89, IDX_TO_EXT(-1), "jns", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JP_REL1632] = { false, 0x8a, IDX_TO_EXT(-1), "jp", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JNP_REL1632] = { false, 0x8b, IDX_TO_EXT(-1), "jnp", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JL_REL1632] = { false, 0x8c, IDX_TO_EXT(-1), "jl", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JNL_REL1632] = { false, 0x8d, IDX_TO_EXT(-1), "jnl", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JNG_REL1632] = { false, 0x8e, IDX_TO_EXT(-1), "jng", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_JG_REL1632] = { false, 0x8f, IDX_TO_EXT(-1), "jg", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_SETO_RM8] = { false, 0x90, IDX_TO_EXT(-1), "seto", XPX_TWO_BYTES },
- [XOP_SETNO_RM8] = { false, 0x91, IDX_TO_EXT(-1), "setno", XPX_TWO_BYTES },
- [XOP_SETB_RM8] = { false, 0x92, IDX_TO_EXT(-1), "setn", XPX_TWO_BYTES },
- [XOP_SETNB_RM8] = { false, 0x93, IDX_TO_EXT(-1), "setnb", XPX_TWO_BYTES },
- [XOP_SETE_RM8] = { false, 0x94, IDX_TO_EXT(-1), "sete", XPX_TWO_BYTES },
- [XOP_SETNE_RM8] = { false, 0x95, IDX_TO_EXT(-1), "setne", XPX_TWO_BYTES },
- [XOP_SETNA_RM8] = { false, 0x96, IDX_TO_EXT(-1), "setna", XPX_TWO_BYTES },
- [XOP_SETA_RM8] = { false, 0x97, IDX_TO_EXT(-1), "seta", XPX_TWO_BYTES },
- [XOP_SETS_RM8] = { false, 0x98, IDX_TO_EXT(-1), "sets", XPX_TWO_BYTES },
- [XOP_SETNS_RM8] = { false, 0x99, IDX_TO_EXT(-1), "setns", XPX_TWO_BYTES },
- [XOP_SETP_RM8] = { false, 0x9a, IDX_TO_EXT(-1), "setp", XPX_TWO_BYTES },
- [XOP_SETNP_RM8] = { false, 0x9b, IDX_TO_EXT(-1), "setnp", XPX_TWO_BYTES },
- [XOP_SETL_RM8] = { false, 0x9c, IDX_TO_EXT(-1), "setl", XPX_TWO_BYTES },
- [XOP_SETNL_RM8] = { false, 0x9d, IDX_TO_EXT(-1), "setnl", XPX_TWO_BYTES },
- [XOP_SETNG_RM8] = { false, 0x9e, IDX_TO_EXT(-1), "setng", XPX_TWO_BYTES },
- [XOP_SETG_RM8] = { false, 0x9f, IDX_TO_EXT(-1), "setg", XPX_TWO_BYTES },
-
-
-
- [XOP_MOVZX_R1632_RM8] = { false, 0xb6, IDX_TO_EXT(-1), "movzx", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOVZX_R1632_RM16] = { false, 0xb7, IDX_TO_EXT(-1), "movzx", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
-
- [XOP_MOVSX_R1632_RM8] = { false, 0xbe, IDX_TO_EXT(-1), "movsx", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE },
- [XOP_MOVSX_R1632_RM1632] = { false, 0xbf, IDX_TO_EXT(-1), "movsx", XPX_TWO_BYTES | XPX_OPERAND_SIZE_OVERRIDE }
-
-};
-
-
-
-
-
-/* Traduit une instruction en version humainement lisible. */
-static const char *x86_get_instruction_text(GX86Instruction *, const GExeFormat *, AsmSyntax);
-
-/* Informe sur une éventuelle référence à une autre instruction. */
-static InstructionLinkType x86_get_instruction_link(const GX86Instruction *, vmpa_t *);
-
-/* Indique si l'instruction correspond à un retour de fonction. */
-static bool x86_instruction_is_return(const GX86Instruction *);
-
-
-
-/* Indique le type défini pour une instruction d'architecture x86. */
-G_DEFINE_TYPE(GX86Instruction, g_x86_instruction, G_TYPE_ARCH_INSTRUCTION);
-
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des instructions pour x86. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_instruction_class_init(GX86InstructionClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instance à initialiser. *
-* *
-* Description : Initialise une instance d'instruction d'architecture x86. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_instruction_init(GX86Instruction *instr)
-{
- GArchInstruction *parent; /* Instance parente */
-
- parent = G_ARCH_INSTRUCTION(instr);
-
- //parent->get_text = (get_instruction_text_fc)x86_get_instruction_text;
- parent->get_link = (get_instruction_link_fc)x86_get_instruction_link;
- //parent->is_return = (is_instruction_return_fc)x86_instruction_is_return;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : type = type d'instruction à représenter. *
-* *
-* Description : Crée une instruction pour l'architecture x86. *
-* *
-* Retour : Architecture mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *g_x86_instruction_new(X86Opcodes type)
-{
- GArchInstruction *result; /* Structure à retourner */
-
- result = g_object_new(G_TYPE_X86_INSTRUCTION, NULL);
-
- G_X86_INSTRUCTION(result)->type = type;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à consulter. *
-* *
-* Description : Fournit l'identifiant de l'opcode représenté. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-X86Opcodes g_x86_instruction_get_opcode(const GX86Instruction *instr)
-{
- return instr->type;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à venir compléter. *
-* prefixes = listes des préfixes rencontrés. *
-* *
-* Description : Attache à une instructions ses préfixes associés. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_x86_instruction_set_prefixes(GX86Instruction *instr, X86Prefix prefixes)
-{
- instr->prefixes = prefixes;
-
-}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* AIDE A LA MISE EN PLACE D'INSTRUCTIONS */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. *
-* len = taille totale des données à analyser. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). [OUT] *
-* care = la lecture de l'instr. veut-elle les opcodes ? [OUT]*
-* *
-* Description : Recherche l'identifiant de la prochaine instruction. *
-* *
-* Retour : Identifiant de la prochaine instruction à tenter de charger. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-X86Opcodes x86_guess_next_instruction(const bin_t *data, off_t pos, off_t len, X86Prefix *prefix, bool *care)
-{
- X86Opcodes result; /* Identifiant à retourner */
- X86Prefix extra; /* Préfixes n'intervenant pas */
- bin_t opcode; /* Opcode à trouver */
-
- extra = XPX_NONE;
- *prefix = XPX_NONE;
-
- while (pos < len)
- switch (data[pos])
- {
- case 0x0f:
- pos++;
- *prefix |= XPX_TWO_BYTES;
- break;
- case 0x66:
- pos++;
- *prefix |= XPX_OPERAND_SIZE_OVERRIDE;
- break;
- case 0xf2:
- pos++;
- extra |= XPX_REPEAT_STR_OPERATION_F2;
- break;
- case 0xf3:
- pos++;
- extra |= XPX_REPEAT_STR_OPERATION_F3;
- break;
- default:
- goto xgni_look_for;
- break;
- }
-
- xgni_look_for:
-
- if (pos == len) return XOP_COUNT;
-
- opcode = data[pos];
-
- for (result = 0; result < XOP_COUNT; result++)
- {
- /* TODO : à intégrer dans la liste */
- if (_instructions[result].prefix & XPX_TWO_BYTES)
- {
- if ((_instructions[result].prefix & *prefix) != (*prefix | XPX_TWO_BYTES)) continue;
- }
- else if ((_instructions[result].prefix & *prefix) != *prefix) continue;
-
- if (_instructions[result].opcode != opcode) continue;
-
- if (_instructions[result].op_extension != IDX_TO_EXT(-1))
- {
- if ((pos + 1) == len) continue;
- if (_instructions[result].op_extension != OPCODE_EXT(data[pos + 1])) continue;
- }
-
- *prefix |= extra;
- *care = _instructions[result].care_of_data;
- break;
-
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à traiter. *
-* format = format du binaire manipulé. *
-* syntax = type de représentation demandée. *
-* *
-* Description : Traduit une instruction en version humainement lisible. *
-* *
-* Retour : Chaîne de caractères à libérer de la mémoire. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static const char *x86_get_instruction_text(GX86Instruction *instr, const GExeFormat *format, AsmSyntax syntax)
-{
- char *result; /* Chaîne nouvelle à renvoyer */
- const char *prefix; /* Préfixe à ajouter */
-
- if (instr->cached_text != NULL)
- return instr->cached_text;
-
- result = strdup(_instructions[instr->type].keyword);
-
- /**
- * Eventuelle répétion de l'instruction.
- * cf. "Repeat String Operation Prefix" (Intel 64 and IA-32 Architectures Software Developer’s Manual Volume 2B)
- * cf. http://www.intel.com/software/products/documentation/vlin/mergedprojects/analyzer_ec/mergedprojects/reference_olh/mergedProjects/instructions/instruct32_hh/vc276.htm
- */
-
- if (instr->prefixes & (XPX_REPEAT_STR_OPERATION_F2 | XPX_REPEAT_STR_OPERATION_F3))
- {
- prefix = NULL;
-
- if (instr->prefixes & XPX_REPEAT_STR_OPERATION_F2)
- switch (instr->type)
- {
- case XOP_CMPS_M8_M8:
- prefix = "repnz ";
- break;
- case XOP_SCAS_AL_M8:
- prefix = "repnz ";
- break;
- default:
- prefix = NULL;
- break;
- }
-
- else if (instr->prefixes & XPX_REPEAT_STR_OPERATION_F3)
- switch (instr->type)
- {
- case XOP_CMPS_M8_M8:
- prefix = "repz ";
- break;
- case XOP_SCAS_AL_M8:
- prefix = "repz ";
- break;
- default:
- prefix = NULL;
- break;
- }
-
- if (prefix != NULL)
- result = strprep(result, prefix);
-
- }
-
- instr->cached_text = result;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à consulter. *
-* addr = eventuelle adresse associée à faire connaître. [OUT] *
-* *
-* Description : Informe sur une éventuelle référence à une autre instruction.*
-* *
-* Retour : Type de lien trouvé ou ILT_NONE si aucun. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static InstructionLinkType x86_get_instruction_link(const GX86Instruction *instr, vmpa_t *addr)
-{
- InstructionLinkType result; /* Type de lien à retourner */
- const GX86RelativeOperand *relative; /* Adresse relative */
-
- switch (instr->type)
- {
- case XOP_JA_REL1632:
- relative = G_X86_RELATIVE_OPERAND(g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0));
- if (g_imm_operand_to_vmpa_t(g_x86_relative_operand_get_value(relative), addr)) result = ILT_JUMP_IF_TRUE;
- else result = ILT_NONE;
- break;
-
- case XOP_JO_REL8:
- case XOP_JNO_REL8:
- case XOP_JB_REL8:
- case XOP_JNB_REL8:
- case XOP_JE_REL8:
- case XOP_JNE_REL8:
- case XOP_JNA_REL8:
- case XOP_JA_REL8:
- case XOP_JS_REL8:
- case XOP_JNS_REL8:
- case XOP_JP_REL8:
- case XOP_JNP_REL8:
- case XOP_JL_REL8:
- case XOP_JNL_REL8:
- case XOP_JNG_REL8:
- case XOP_JG_REL8:
- relative = G_X86_RELATIVE_OPERAND(g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0));
- if (g_imm_operand_to_vmpa_t(g_x86_relative_operand_get_value(relative), addr)) result = ILT_JUMP_IF_TRUE;
- else result = ILT_NONE;
- break;
-
- case XOP_CALL_REL1632:
- relative = G_X86_RELATIVE_OPERAND(g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0));
- if (g_imm_operand_to_vmpa_t(g_x86_relative_operand_get_value(relative), addr)) result = ILT_CALL;
- else result = ILT_NONE;
- break;
-
- case XOP_JMP_REL1632:
- relative = G_X86_RELATIVE_OPERAND(g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0));
- if (g_imm_operand_to_vmpa_t(g_x86_relative_operand_get_value(relative), addr)) result = ILT_JUMP;
- else result = ILT_NONE;
- break;
-
- case XOP_JMP_REL8:
- relative = G_X86_RELATIVE_OPERAND(g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0));
- if (g_imm_operand_to_vmpa_t(g_x86_relative_operand_get_value(relative), addr)) result = ILT_JUMP;
- else result = ILT_NONE;
- break;
-
- default:
- result = ILT_NONE;
- break;
-
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction à consulter. *
-* *
-* Description : Indique si l'instruction correspond à un retour de fonction. *
-* *
-* Retour : true si l'instruction est un 'return' quelconque ou false. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool x86_instruction_is_return(const GX86Instruction *instr)
-{
- return false;/* FIXME (instr->type == XOP_RET);*/
-
-}
diff --git a/src/arch/x86/instruction.h b/src/arch/x86/instruction.h
deleted file mode 100644
index c72effe..0000000
--- a/src/arch/x86/instruction.h
+++ /dev/null
@@ -1,425 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * instruction.h - prototypes pour la gestion des instructions de l'architecture x86
- *
- * Copyright (C) 2008-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_INSTRUCTION_H
-#define _ARCH_X86_INSTRUCTION_H
-
-
-#include "../instruction.h"
-
-
-/* Types de préfixes pour x86 */
-typedef enum _X86Prefix X86Prefix;
-
-
-/* Enumération de tous les opcodes */
-typedef enum _X86Opcodes
-{
- /* Instructions avec opcode sur un octet */
-
- XOP_ADD_RM8_R8, /* add (0x00) */
- XOP_ADD_RM1632_R1632, /* add ([0x66] 0x01) */
- XOP_ADD_R8_RM8, /* add (0x02) */
- XOP_ADD_R1632_RM1632, /* add ([0x66] 0x03) */
- XOP_ADD_AL_IMM8, /* add (0x04) */
- XOP_ADD_E_AX_IMM1632, /* sub ([0x66] 0x05) */
-
- XOP_OR_RM8_R8, /* or (0x08) */
- XOP_OR_RM1632_R1632, /* or ([0x66] 0x09) */
- XOP_OR_R8_RM8, /* or (0x0a) */
- XOP_OR_R1632_RM1632, /* or ([0x66] 0x0b) */
- XOP_OR_AL_IMM8, /* or (0x0c) */
-
- XOP_ADC_RM8_R8, /* adc (0x10) */
-
- XOP_SBB_RM1632_R1632, /* and ([0x66] 0x19) */
-
- XOP_AND_RM8_R8, /* and (0x20) */
- XOP_AND_RM1632_R1632, /* and ([0x66] 0x21) */
-
- XOP_AND_AL_IMM8, /* and (0x24) */
- XOP_AND_E_AX_IMM1632, /* and ([0x66] 0x25) */
-
- XOP_SUB_RM1632_R1632, /* sub ([0x66] 0x29) */
-
- XOP_SUB_R8_RM8, /* sub (0x2a) */
- XOP_SUB_R1632_RM1632, /* sub ([0x66] 0x2b) */
- XOP_SUB_AL_IMM8, /* sub (0x2c) */
-
- XOP_SUB_E_AX_IMM1632, /* sub ([0x66] 0x2d) */
-
-
- XOP_XOR_RM8_R8, /* xor (0x30) */
- XOP_XOR_RM1632_R1632, /* xor ([0x66] 0x31) */
- XOP_XOR_R8_RM8, /* xor (0x32) */
- XOP_XOR_R1632_RM1632, /* xor ([0x66] 0x33) */
- XOP_XOR_AL_IMM8, /* xor (0x34) */
- XOP_XOR_E_AX_IMM1632, /* xor ([0x66] 0x35) */
-
- XOP_CMP_RM8_R8, /* cmp (0x38) */
- XOP_CMP_RM1632_R1632, /* cmp ([0x66] 0x39) */
- XOP_CMP_R8_RM8, /* cmp (0x3a) */
- XOP_CMP_R1632_RM1632, /* cmp ([0x66] 0x3b) */
- XOP_CMP_AL_IMM8, /* cmp (0x3c) */
- XOP_CMP_E_AX_IMM1632, /* cmp ([0x66] 0x3d) */
-
-
- XOP_INC_E_AX, /* inc ([0x66] 0x40) */
- XOP_INC_E_CX, /* inc ([0x66] 0x41) */
- XOP_INC_E_DX, /* inc ([0x66] 0x42) */
- XOP_INC_E_BX, /* inc ([0x66] 0x43) */
- XOP_INC_E_SP, /* inc ([0x66] 0x44) */
- XOP_INC_E_BP, /* inc ([0x66] 0x45) */
- XOP_INC_E_SI, /* inc ([0x66] 0x46) */
- XOP_INC_E_DI, /* inc ([0x66] 0x47) */
- XOP_DEC_E_AX, /* dec ([0x66] 0x48) */
- XOP_DEC_E_CX, /* dec ([0x66] 0x49) */
- XOP_DEC_E_DX, /* dec ([0x66] 0x4a) */
- XOP_DEC_E_BX, /* dec ([0x66] 0x4b) */
- XOP_DEC_E_SP, /* dec ([0x66] 0x4c) */
- XOP_DEC_E_BP, /* dec ([0x66] 0x4d) */
- XOP_DEC_E_SI, /* dec ([0x66] 0x4e) */
- XOP_DEC_E_DI, /* dec ([0x66] 0x4f) */
- XOP_PUSH_E_AX, /* push ([0x66] 0x50) */
- XOP_PUSH_E_CX, /* push ([0x66] 0x51) */
- XOP_PUSH_E_DX, /* push ([0x66] 0x52) */
- XOP_PUSH_E_BX, /* push ([0x66] 0x53) */
- XOP_PUSH_E_SP, /* push ([0x66] 0x54) */
- XOP_PUSH_E_BP, /* push ([0x66] 0x55) */
- XOP_PUSH_E_SI, /* push ([0x66] 0x56) */
- XOP_PUSH_E_DI, /* push ([0x66] 0x57) */
- XOP_POP_E_AX, /* pop ([0x66] 0x58) */
- XOP_POP_E_CX, /* pop ([0x66] 0x59) */
- XOP_POP_E_DX, /* pop ([0x66] 0x5a) */
- XOP_POP_E_BX, /* pop ([0x66] 0x5b) */
- XOP_POP_E_SP, /* pop ([0x66] 0x5c) */
- XOP_POP_E_BP, /* pop ([0x66] 0x5d) */
- XOP_POP_E_SI, /* pop ([0x66] 0x5e) */
- XOP_POP_E_DI, /* pop ([0x66] 0x5f) */
-
- XOP_POPA, /* popa (0x61) */
-
- XOP_ARPL_RM16_R16, /* arpl (0x63) */
-
- XOP_PUSH_IMM1632, /* push ([0x66] 0x68) */
- XOP_IMUL_R1632_RM1632_IMM1632, /* imul ([0x66] 0x69) */
-
- XOP_IMUL_RM1632_IMM8, /* imul ([0x66] 0x6b) */
-
- XOP_JO_REL8, /* jo (0x70) */
- XOP_JNO_REL8, /* jno (0x71) */
- XOP_JB_REL8, /* jb (0x72) */
- XOP_JNB_REL8, /* jnb (0x73) */
- XOP_JE_REL8, /* je (0x74) */
- XOP_JNE_REL8, /* jne (0x75) */
- XOP_JNA_REL8, /* jna (0x76) */
- XOP_JA_REL8, /* ja (0x77) */
- XOP_JS_REL8, /* js (0x78) */
- XOP_JNS_REL8, /* jns (0x79) */
- XOP_JP_REL8, /* jp (0x7a) */
- XOP_JNP_REL8, /* jnp (0x7b) */
- XOP_JL_REL8, /* jl (0x7c) */
- XOP_JNL_REL8, /* jnl (0x7d) */
- XOP_JNG_REL8, /* jng (0x7e) */
- XOP_JG_REL8, /* jg (0x7f) */
- XOP_ADD_RM8_IMM8, /* add (0x80 0) */
- XOP_OR_RM8_IMM8, /* or (0x80 1) */
- XOP_ADC_RM8_IMM8, /* adc (0x80 2) */
- XOP_SBB_RM8_IMM8, /* sbb (0x80 3) */
- XOP_AND_RM8_IMM8, /* and (0x80 4) */
- XOP_SUB_RM8_IMM8, /* sub (0x80 5) */
- XOP_XOR_RM8_IMM8, /* xor (0x80 6) */
- XOP_CMP_RM8_IMM8, /* cmp (0x80 7) */
- XOP_ADD_RM1632_IMM1632, /* add ([0x66] 0x81 0) */
- XOP_OR_RM1632_IMM1632, /* or ([0x66] 0x81 1) */
- XOP_ADC_RM1632_IMM1632, /* adc ([0x66] 0x81 2) */
- XOP_SBB_RM1632_IMM1632, /* sbb ([0x66] 0x81 3) */
- XOP_AND_RM1632_IMM1632, /* and ([0x66] 0x81 4) */
- XOP_SUB_RM1632_IMM1632, /* sub ([0x66] 0x81 5) */
- XOP_XOR_RM1632_IMM1632, /* xor ([0x66] 0x81 6) */
- XOP_CMP_RM1632_IMM1632, /* xor ([0x66] 0x81 7) */
-
-
- XOP_ADD_RM1632_IMM8, /* add ([0x66] 0x83 0) */
- XOP_OR_RM1632_IMM8, /* or ([0x66] 0x83 1) */
- XOP_ADC_RM1632_IMM8, /* adc ([0x66] 0x83 2) */
- XOP_SBB_RM1632_IMM8, /* sbb ([0x66] 0x83 3) */
- XOP_AND_RM1632_IMM8, /* and ([0x66] 0x83 4) */
- XOP_SUB_RM1632_IMM8, /* sub ([0x66] 0x83 5) */
- XOP_XOR_RM1632_IMM8, /* xor ([0x66] 0x83 6) */
- XOP_CMP_RM1632_IMM8, /* cmp ([0x66] 0x83 7) */
-
-
- XOP_TEST_RM8_R8, /* test (0x84) */
- XOP_TEST_RM1632_R1632, /* test ([0x66] 0x85) */
-
-
-
- XOP_MOV_RM8_R8, /* mov (0x88) */
- XOP_MOV_RM1632_R1632, /* mov ([0x66] 0x89) */
-
- XOP_MOV_R1632_RM1632, /* mov ([0x66] 0x8b) */
-
-
-
- XOP_LEA_R1632_M, /* lea ([0x66] 0x8d) */
-
-
- XOP_NOP, /* nop (0x90) */
-
-
- XOP_XCHG_R1632_E_AX, /* xchg ([0x66] 0x90) */
- XOP_XCHG_R1632_E_CX, /* xchg ([0x66] 0x91) */
- XOP_XCHG_R1632_E_DX, /* xchg ([0x66] 0x92) */
- XOP_XCHG_R1632_E_BX, /* xchg ([0x66] 0x93) */
- XOP_XCHG_R1632_E_SP, /* xchg ([0x66] 0x94) */
- XOP_XCHG_R1632_E_BP, /* xchg ([0x66] 0x95) */
- XOP_XCHG_R1632_E_SI, /* xchg ([0x66] 0x96) */
- XOP_XCHG_R1632_E_DI, /* xchg ([0x66] 0x97) */
-
-
- XOP_MOV_AL_MOFFS8, /* mov (0xa0) */
- XOP_MOV_E_AX_MOFFS1632, /* mov ([0x66] 0xa1) */
- XOP_MOV_MOFFS8_AL, /* mov (0xa2) */
- XOP_MOV_MOFFS1632_E_AX, /* mov ([0x66] 0xa3) */
-
-
-
- XOP_MOVS_M1632_M1632, /* movs ([0x66] 0xa5) */
- XOP_CMPS_M8_M8, /* cmps (0xa6) */
-
- XOP_TEST_AL_IMM8, /* test (0xa8) */
- XOP_TEST_E_AX_IMM1632, /* test ([0x66] 0xa9) */
-
- XOP_STOS_M1632_E_AX, /* stos ([0x66] 0xab) */
-
- XOP_SCAS_AL_M8, /* scas (0xae) */
-
-
- XOP_MOV_AL_IMM8, /* mov (0xb0) */
- XOP_MOV_CL_IMM8, /* mov (0xb1) */
- XOP_MOV_DL_IMM8, /* mov (0xb2) */
- XOP_MOV_BL_IMM8, /* mov (0xb3) */
- XOP_MOV_AH_IMM8, /* mov (0xb4) */
- XOP_MOV_CH_IMM8, /* mov (0xb5) */
- XOP_MOV_DH_IMM8, /* mov (0xb6) */
- XOP_MOV_BH_IMM8, /* mov (0xb7) */
- XOP_MOV_E_AX_IMM1632, /* mov ([0x66] 0xb8) */
- XOP_MOV_E_CX_IMM1632, /* mov ([0x66] 0xb9) */
- XOP_MOV_E_DX_IMM1632, /* mov ([0x66] 0xba) */
- XOP_MOV_E_BX_IMM1632, /* mov ([0x66] 0xbb) */
- XOP_MOV_E_SP_IMM1632, /* mov ([0x66] 0xbc) */
- XOP_MOV_E_BP_IMM1632, /* mov ([0x66] 0xbd) */
- XOP_MOV_E_SI_IMM1632, /* mov ([0x66] 0xbe) */
- XOP_MOV_E_DI_IMM1632, /* mov ([0x66] 0xbf) */
- XOP_ROL_RM8_IMM8, /* rol (0xc0 0) */
- XOP_ROR_RM8_IMM8, /* ror (0xc0 1) */
- XOP_RCL_RM8_IMM8, /* rcl (0xc0 2) */
- XOP_RCR_RM8_IMM8, /* rcr (0xc0 3) */
- XOP_SHL_RM8_IMM8, /* shl (0xc0 4) */
- XOP_SHR_RM8_IMM8, /* shr (0xc0 5) */
- XOP_SAL_RM8_IMM8, /* sal (0xc0 6) */
- XOP_SAR_RM8_IMM8, /* sar (0xc0 7) */
- XOP_ROL_RM1632_IMM8, /* rol ([0x66] 0xc1 0) */
- XOP_ROR_RM1632_IMM8, /* ror ([0x66] 0xc1 1) */
- XOP_RCL_RM1632_IMM8, /* rcl ([0x66] 0xc1 2) */
- XOP_RCR_RM1632_IMM8, /* rcr ([0x66] 0xc1 3) */
- XOP_SHL_RM1632_IMM8, /* shl ([0x66] 0xc1 4) */
- XOP_SHR_RM1632_IMM8, /* shr ([0x66] 0xc1 5) */
- XOP_SAL_RM1632_IMM8, /* sal ([0x66] 0xc1 6) */
- XOP_SAR_RM1632_IMM8, /* sar ([0x66] 0xc1 7) */
-
-
- XOP_RETN_IMM16, /* retn (0xc2) */
- XOP_RETN, /* ret (0xc3) */
-
- XOP_MOV_RM8_IMM8, /* mov (0xc6 0) */
- XOP_MOV_RM1632_IMM1632, /* mov ([0x66] 0xc7 0) */
-
- XOP_LEAVE, /* leave (0xc9) */
- XOP_RETF_IMM16, /* retn (0xca) */
- XOP_RETF, /* ret (0xcb) */
- XOP_INT_3, /* int 3 (0xcc) */
- XOP_INT, /* int (0xcd) */
-
-
- XOP_ROL_RM8_1, /* rol (0xd0 0) */
- XOP_ROR_RM8_1, /* ror (0xd0 1) */
- XOP_RCL_RM8_1, /* rcl (0xd0 2) */
- XOP_RCR_RM8_1, /* rcr (0xd0 3) */
- XOP_SHL_RM8_1, /* shl (0xd0 4) */
- XOP_SHR_RM8_1, /* shr (0xd0 5) */
- XOP_SAL_RM8_1, /* sal (0xd0 6) */
- XOP_SAR_RM8_1, /* sar (0xd0 7) */
- XOP_ROL_RM1632_1, /* rol ([0x66] 0xd1 0) */
- XOP_ROR_RM1632_1, /* ror ([0x66] 0xd1 1) */
- XOP_RCL_RM1632_1, /* rcl ([0x66] 0xd1 2) */
- XOP_RCR_RM1632_1, /* rcr ([0x66] 0xd1 3) */
- XOP_SHL_RM1632_1, /* shl ([0x66] 0xd1 4) */
- XOP_SHR_RM1632_1, /* shr ([0x66] 0xd1 5) */
- XOP_SAL_RM1632_1, /* sal ([0x66] 0xd1 6) */
- XOP_SAR_RM1632_1, /* sar ([0x66] 0xd1 7) */
- XOP_ROL_RM8_CL, /* rol (0xd2 0) */
- XOP_ROR_RM8_CL, /* ror (0xd2 1) */
- XOP_RCL_RM8_CL, /* rcl (0xd2 2) */
- XOP_RCR_RM8_CL, /* rcr (0xd2 3) */
- XOP_SHL_RM8_CL, /* shl (0xd2 4) */
- XOP_SHR_RM8_CL, /* shr (0xd2 5) */
- XOP_SAL_RM8_CL, /* sal (0xd2 6) */
- XOP_SAR_RM8_CL, /* sar (0xd2 7) */
- XOP_ROL_RM1632_CL, /* rol ([0x66] 0xd3 0) */
- XOP_ROR_RM1632_CL, /* ror ([0x66] 0xd3 1) */
- XOP_RCL_RM1632_CL, /* rcl ([0x66] 0xd3 2) */
- XOP_RCR_RM1632_CL, /* rcr ([0x66] 0xd3 3) */
- XOP_SHL_RM1632_CL, /* shl ([0x66] 0xd3 4) */
- XOP_SHR_RM1632_CL, /* shr ([0x66] 0xd3 5) */
- XOP_SAL_RM1632_CL, /* sal ([0x66] 0xd3 6) */
- XOP_SAR_RM1632_CL, /* sar ([0x66] 0xd3 7) */
-
-
- XOP_CALL_REL1632, /* call ([0x66] 0xe8) */
- XOP_JMP_REL1632, /* jmp ([0x66] 0xe9) */
-
- XOP_JMP_REL8, /* jmp (0xeb) */
-
- XOP_HLT, /* hlt (0xf4) */
-
- XOP_TEST_RM8_IMM8, /* test (0xf6 0) */
- XOP_TEST_RM8_IMM8_BIS, /* test (0xf6 1) */
- XOP_NOT_RM8, /* not (0xf6 2) */
-
- XOP_TEST_RM1632_IMM1632, /* test ([0x66] 0xf7 0) */
- XOP_TEST_RM1632_IMM1632_BIS, /* test ([0x66] 0xf7 1) */
- XOP_NOT_RM1632, /* not ([0x66] 0xf7 2) */
-
- XOP_IMUL_RM1632, /* imul ([0x66] 0xf7 5) */
-
- XOP_CLD, /* cld (0xfc) */
-
- XOP_INC_RM8, /* inc (0xfe 0) */
- XOP_DEC_RM8, /* dec (0xfe 1) */
- XOP_INC_RM1632, /* inc ([0x66] 0xff 0) */
- XOP_DEC_RM1632, /* dec ([0x66] 0xff 1) */
- XOP_CALL_RM1632, /* call ([0x66] 0xff 2) */
- XOP_JMP_RM1632, /* jmp ([0x66] 0xff 4) */
- XOP_PUSH_RM1632, /* push ([0x66] 0xff 6) */
-
- /* Instructions avec opcode sur deux octets */
-
- XOP_JO_REL1632, /* jo (0x0f 0x80) */
- XOP_JNO_REL1632, /* jno (0x0f 0x81) */
- XOP_JB_REL1632, /* jb (0x0f 0x82) */
- XOP_JNB_REL1632, /* jnb (0x0f 0x83) */
- XOP_JE_REL1632, /* je (0x0f 0x84) */
- XOP_JNE_REL1632, /* jne (0x0f 0x85) */
- XOP_JNA_REL1632, /* jna (0x0f 0x86) */
- XOP_JA_REL1632, /* ja (0x0f 0x87) */
- XOP_JS_REL1632, /* js (0x0f 0x88) */
- XOP_JNS_REL1632, /* jns (0x0f 0x89) */
- XOP_JP_REL1632, /* jp (0x0f 0x8a) */
- XOP_JNP_REL1632, /* jnp (0x0f 0x8b) */
- XOP_JL_REL1632, /* jl (0x0f 0x8c) */
- XOP_JNL_REL1632, /* jnl (0x0f 0x8d) */
- XOP_JNG_REL1632, /* jng (0x0f 0x8e) */
- XOP_JG_REL1632, /* jg (0x0f 0x8f) */
- XOP_SETO_RM8, /* seto (0x0f 0x90) */
- XOP_SETNO_RM8, /* setno (0x0f 0x91) */
- XOP_SETB_RM8, /* setb (0x0f 0x92) */
- XOP_SETNB_RM8, /* setnb (0x0f 0x93) */
- XOP_SETE_RM8, /* sete (0x0f 0x94) */
- XOP_SETNE_RM8, /* setne (0x0f 0x95) */
- XOP_SETNA_RM8, /* setna (0x0f 0x96) */
- XOP_SETA_RM8, /* seta (0x0f 0x97) */
- XOP_SETS_RM8, /* sets (0x0f 0x98) */
- XOP_SETNS_RM8, /* setns (0x0f 0x99) */
- XOP_SETP_RM8, /* setp (0x0f 0x9a) */
- XOP_SETNP_RM8, /* setnp (0x0f 0x9b) */
- XOP_SETL_RM8, /* setl (0x0f 0x9c) */
- XOP_SETNL_RM8, /* setnl (0x0f 0x9d) */
- XOP_SETNG_RM8, /* setng (0x0f 0x9e) */
- XOP_SETG_RM8, /* setg (0x0f 0x9f) */
-
-
-
- XOP_MOVZX_R1632_RM8, /* movzx ([0x66] 0x0f 0xb6) */
- XOP_MOVZX_R1632_RM16, /* movzx ([0x66] 0x0f 0xb7) */
-
- XOP_MOVSX_R1632_RM8, /* movsx ([0x66] 0x0f 0xbe) */
- XOP_MOVSX_R1632_RM1632, /* movsx ([0x66] 0x0f 0xbf) */
-
- XOP_COUNT
-
-} X86Opcodes;
-
-
-#define G_TYPE_X86_INSTRUCTION g_x86_instruction_get_type()
-#define G_X86_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_x86_instruction_get_type(), GX86Instruction))
-#define G_IS_X86_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_x86_instruction_get_type()))
-#define G_X86_INSTRUCTION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), g_x86_instruction_get_type(), GX86InstructionIface))
-
-
-/* Définition générique d'une instruction d'architecture x86 (instance) */
-typedef struct _GX86Instruction GX86Instruction;
-
-/* Définition générique d'une instruction d'architecture x86 (classe) */
-typedef struct _GX86InstructionClass GX86InstructionClass;
-
-
-/* Indique le type défini pour une instruction d'architecture x86. */
-GType g_x86_instruction_get_type(void);
-
-/* Crée une instruction pour l'architecture x86. */
-GArchInstruction *g_x86_instruction_new(X86Opcodes);
-
-/* Fournit l'identifiant de l'opcode représenté. */
-X86Opcodes g_x86_instruction_get_opcode(const GX86Instruction *);
-
-/* Attache à une instructions ses préfixes associés. */
-void g_x86_instruction_set_prefixes(GX86Instruction *, X86Prefix);
-
-
-
-/* --------------------- AIDE A LA MISE EN PLACE D'INSTRUCTIONS --------------------- */
-
-
-/* Types de préfixes pour x86 */
-enum _X86Prefix
-{
- XPX_NONE = (0 << 0), /* Code d'instruction pur */
-
- XPX_OPERAND_SIZE_OVERRIDE = (1 << 0), /* Taille des opérandes */
-
- XPX_REPEAT_STR_OPERATION_F2 = (1 << 1), /* Boucle pour les chaînes #1 */
- XPX_REPEAT_STR_OPERATION_F3 = (1 << 2), /* Boucle pour les chaînes #2 */
-
- XPX_TWO_BYTES = (1 << 3) /* Instruction sur deux octets */
-
-};
-
-
-/* Recherche l'identifiant de la prochaine instruction. */
-X86Opcodes x86_guess_next_instruction(const bin_t *, off_t, off_t, X86Prefix *, bool *);
-
-
-
-#endif /* _ARCH_X86_INSTRUCTION_H */
diff --git a/src/arch/x86/opcodes/Makefile.am b/src/arch/x86/opcodes/Makefile.am
deleted file mode 100644
index 72eed13..0000000
--- a/src/arch/x86/opcodes/Makefile.am
+++ /dev/null
@@ -1,55 +0,0 @@
-
-noinst_LTLIBRARIES = libarchx86opcodes.la
-
-libarchx86opcodes_la_SOURCES = \
- adc.c \
- add.c \
- and.c \
- arpl.c \
- call.c \
- cld.c \
- cmp.c \
- cmps.c \
- dec.c \
- hlt.c \
- inc.c \
- int.c \
- jump.c \
- lea.c \
- leave.c \
- mov.c \
- movs.c \
- movsx.c \
- movzx.c \
- mul.c \
- nop.c \
- not.c \
- opcodes.h \
- or.c \
- pop.c \
- push.c \
- rcl.c \
- rcr.c \
- ret.c \
- rol.c \
- ror.c \
- sar.c \
- sbb.c \
- scas.c \
- set.c \
- shl.c \
- shr.c \
- stos.c \
- sub.c \
- test.c \
- xchg.c \
- xor.c
-
-libarchx86opcodes_la_LIBADD =
-
-libarchx86opcodes_la_CFLAGS = $(AM_CFLAGS)
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
diff --git a/src/arch/x86/opcodes/adc.c b/src/arch/x86/opcodes/adc.c
deleted file mode 100644
index e85f2f4..0000000
--- a/src/arch/x86/opcodes/adc.c
+++ /dev/null
@@ -1,161 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_adc.c - décodage des additions avec retenue
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'adc' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_adc_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ADC_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* *
-* Description : Décode une instruction de type 'adc' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_adc_rm8_r8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ADC_RM8_R8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_R8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'adc' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_adc_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ADC_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'adc' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_adc_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ADC_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/add.c b/src/arch/x86/opcodes/add.c
deleted file mode 100644
index aaaec61..0000000
--- a/src/arch/x86/opcodes/add.c
+++ /dev/null
@@ -1,340 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_add.c - décodage des additions
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add al, ...' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_al_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ADD_AL_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add [e]ax, ...' (16/32 bits).*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_e_ax_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ADD_E_AX_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_E_AX, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_r8_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ADD_R8_RM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R8, X86_OTP_RM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ADD_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_rm8_r8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ADD_RM8_R8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_R8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_r1632_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ADD_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ADD_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ADD_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'add' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_add_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ADD_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/and.c b/src/arch/x86/opcodes/and.c
deleted file mode 100644
index c1cf21b..0000000
--- a/src/arch/x86/opcodes/and.c
+++ /dev/null
@@ -1,271 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_and.c - décodage des ET logiques
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'and al, ...' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_and_al_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_AND_AL_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'and [e]ax, ...' (16/32 bits).*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_and_e_ax_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_AND_E_AX_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_E_AX, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'and' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_and_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_AND_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'and' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_and_rm8_r8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_AND_RM8_R8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_R8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'and' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_and_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_AND_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'and' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_and_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_AND_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'and' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_and_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_AND_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/arpl.c b/src/arch/x86/opcodes/arpl.c
deleted file mode 100644
index da76b4f..0000000
--- a/src/arch/x86/opcodes/arpl.c
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_arpl.c - décodage des ajustements de champs RPL
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'arpl' (16 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_arpl_rm16_r16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ARPL_RM16_R16);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, MDS_16_BITS))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/call.c b/src/arch/x86/opcodes/call.c
deleted file mode 100644
index cdd2672..0000000
--- a/src/arch/x86/opcodes/call.c
+++ /dev/null
@@ -1,100 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_call.c - décodage des appels
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'call' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_call_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_CALL_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'call' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_call_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_CALL_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/cld.c b/src/arch/x86/opcodes/cld.c
deleted file mode 100644
index bb4e714..0000000
--- a/src/arch/x86/opcodes/cld.c
+++ /dev/null
@@ -1,56 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_cld.c - décodage de la suppression du drapeau de direction
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cld'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cld(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_CLD);
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/cmp.c b/src/arch/x86/opcodes/cmp.c
deleted file mode 100644
index ef631d4..0000000
--- a/src/arch/x86/opcodes/cmp.c
+++ /dev/null
@@ -1,340 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_cmp.c - décodage des comparaisons d'opérandes
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_al_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_CMP_AL_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_e_ax_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_CMP_E_AX_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_E_AX, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_r8_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_CMP_R8_RM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R8, X86_OTP_RM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_r1632_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_CMP_R1632_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_CMP_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_rm8_r8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_CMP_RM8_R8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_R8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_CMP_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_CMP_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmp' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmp_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_CMP_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/cmps.c b/src/arch/x86/opcodes/cmps.c
deleted file mode 100644
index d48253d..0000000
--- a/src/arch/x86/opcodes/cmps.c
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_cmps.c - décodage des comparaisons de chaînes et de scalaires
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'cmps' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_cmps_m8_m8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_CMPS_M8_M8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_SRC_8, X86_OTP_DST_8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/dec.c b/src/arch/x86/opcodes/dec.c
deleted file mode 100644
index ad65604..0000000
--- a/src/arch/x86/opcodes/dec.c
+++ /dev/null
@@ -1,137 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_dec.c - décodage des décrémentations
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'dec' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_dec_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- X86Opcodes opcode; /* Instruction effective */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- opcode = XOP_DEC_E_AX + (data[*pos] - 0x48);
-
- result = g_x86_instruction_new(opcode);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_OP_R1632, oprsize, 0x48))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'dec' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_dec_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_DEC_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'dec' (16/32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_dec_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_DEC_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/hlt.c b/src/arch/x86/opcodes/hlt.c
deleted file mode 100644
index bb14269..0000000
--- a/src/arch/x86/opcodes/hlt.c
+++ /dev/null
@@ -1,56 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_hlt.c - décodage de la mise en pause du processeur
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'hlt'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_hlt(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_HLT);
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/inc.c b/src/arch/x86/opcodes/inc.c
deleted file mode 100644
index dd37034..0000000
--- a/src/arch/x86/opcodes/inc.c
+++ /dev/null
@@ -1,137 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_inc.c - décodage des incrémentations
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'inc' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_inc_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- X86Opcodes opcode; /* Instruction effective */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- opcode = XOP_INC_E_AX + (data[*pos] - 0x40);
-
- result = g_x86_instruction_new(opcode);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_OP_R1632, oprsize, 0x40))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'inc' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_inc_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_INC_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'inc' (16/32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_inc_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_INC_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/int.c b/src/arch/x86/opcodes/int.c
deleted file mode 100644
index 5e1550c..0000000
--- a/src/arch/x86/opcodes/int.c
+++ /dev/null
@@ -1,93 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_int.c - décodage des instructions d'interruption
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'int 3'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_int_3(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- GArchOperand *three; /* Argument artificiel */
-
- result = g_x86_instruction_new(XOP_INT_3);
-
- three = g_imm_operand_new_from_value(MDS_8_BITS, 3);
- g_arch_instruction_attach_extra_operand(result, three);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'int'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_int_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_INT);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/jump.c b/src/arch/x86/opcodes/jump.c
deleted file mode 100644
index ae9f68f..0000000
--- a/src/arch/x86/opcodes/jump.c
+++ /dev/null
@@ -1,1238 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_jump.c - décodage des sauts inconditionnels
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'ja' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_ja_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JA_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'ja' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_ja_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JA_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jb' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jb_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JB_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jb' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jb_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JB_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'je' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_je_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JE_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'je' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_je_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JE_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jg' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jg_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JG_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jg' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jg_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JG_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jl' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jl_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JL_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jl' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jl_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JL_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jmp' (petit saut). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jmp_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JMP_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jmp' (grand saut relatif). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jmp_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JMP_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jmp' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jmp_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JMP_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM1632, oprsize))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jna' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jna_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JNA_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jna' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jna_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JNA_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jnb' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jnb_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JNB_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jnb' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jnb_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JNB_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jne' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jne_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JNE_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jne' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jne_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JNE_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jng' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jng_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JNG_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jng' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jng_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JNG_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jnl' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jnl_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JNL_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jnl' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jnl_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JNL_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jno' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jno_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JNO_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jno' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jno_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JNO_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jnp' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jnp_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JNP_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jnp' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jnp_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JNP_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jns' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jns_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JNS_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jns' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jns_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JNS_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jo' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jo_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JO_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jo' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jo_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JO_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jp' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jp_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JP_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'jp' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_jp_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JP_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'js' (saut 8b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_js_rel8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_JS_REL8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL8, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'js' (saut 16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_js_rel1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_JS_REL1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_REL1632, oprsize, addr))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/lea.c b/src/arch/x86/opcodes/lea.c
deleted file mode 100644
index 3bbfad5..0000000
--- a/src/arch/x86/opcodes/lea.c
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_lea.c - décodage des chargements d'adresse effective
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'lea' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_lea_r1632_m(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_LEA_R1632_M);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/leave.c b/src/arch/x86/opcodes/leave.c
deleted file mode 100644
index ede39f0..0000000
--- a/src/arch/x86/opcodes/leave.c
+++ /dev/null
@@ -1,56 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_leave.c - décodage de la préparation d'une sortie d'appel
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'leave'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_leave(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_LEAVE);
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/mov.c b/src/arch/x86/opcodes/mov.c
deleted file mode 100644
index 42cc2b8..0000000
--- a/src/arch/x86/opcodes/mov.c
+++ /dev/null
@@ -1,410 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_mov.c - décodage des déplacements de données
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov al, ...' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_al_moffs8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_MOV_AL_MOFFS8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_MOFFS8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov [e]ax, ...' (16/32 bits).*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_e_ax_moffs1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOV_E_AX_MOFFS1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_E_AX, X86_OTP_MOFFS1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov ..., al' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_moffs8_al(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_MOV_MOFFS8_AL);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_MOFFS8, X86_OTP_AL))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov ..., [e]ax' (16/32 bits).*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_moffs1632_e_ax(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOV_MOFFS1632_E_AX);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_MOFFS1632, X86_OTP_E_AX, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_r8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- X86Opcodes opcode; /* Instruction effective */
-
- opcode = XOP_MOV_AL_IMM8 + (data[*pos] - 0xb0);
-
- result = g_x86_instruction_new(opcode);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_OP_R8, X86_OTP_IMM8, 0xb0))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_r1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- X86Opcodes opcode; /* Instruction effective */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- opcode = XOP_MOV_E_AX_IMM1632 + (data[*pos] - 0xb8);
-
- result = g_x86_instruction_new(opcode);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_OP_R1632, X86_OTP_IMM1632, oprsize, 0xb8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_r1632_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOV_R1632_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_MOV_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* *
-* Description : Décode une instruction de type 'mov' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_rm8_r8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_MOV_RM8_R8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_R8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOV_RM1632_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'mov' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_mov_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOV_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/movs.c b/src/arch/x86/opcodes/movs.c
deleted file mode 100644
index f523771..0000000
--- a/src/arch/x86/opcodes/movs.c
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_movs.c - décodage des déplacements de données
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'movs' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_movs_m1632_m1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOVS_M1632_M1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_DST_1632, X86_OTP_SRC_1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/movsx.c b/src/arch/x86/opcodes/movsx.c
deleted file mode 100644
index dbe0152..0000000
--- a/src/arch/x86/opcodes/movsx.c
+++ /dev/null
@@ -1,100 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_movsx.c - décodage des copies d'opérandes sans mise à zéro
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'movsx' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_movsx_r1632_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOVSX_R1632_RM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'movsx' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_movsx_r1632_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOVSX_R1632_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/movzx.c b/src/arch/x86/opcodes/movzx.c
deleted file mode 100644
index b12c9d1..0000000
--- a/src/arch/x86/opcodes/movzx.c
+++ /dev/null
@@ -1,100 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_movzx.c - décodage des copies d'opérandes avec mise à zéro
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'movzx' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_movzx_r1632_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOVZX_R1632_RM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'movzx' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_movzx_r1632_rm16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_MOVZX_R1632_RM16);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM16, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/mul.c b/src/arch/x86/opcodes/mul.c
deleted file mode 100644
index 0cc9ad5..0000000
--- a/src/arch/x86/opcodes/mul.c
+++ /dev/null
@@ -1,137 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_mul.c - décodage des multiplications
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'imul' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_imul_r1632_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_IMUL_R1632_RM1632_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_three_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'imul' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_imul_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_IMUL_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'imul' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_imul_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_IMUL_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
diff --git a/src/arch/x86/opcodes/nop.c b/src/arch/x86/opcodes/nop.c
deleted file mode 100644
index 74e88a4..0000000
--- a/src/arch/x86/opcodes/nop.c
+++ /dev/null
@@ -1,56 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_nop.c - décodage de l'instruction nulle
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'nop'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_nop(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_NOP);
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/not.c b/src/arch/x86/opcodes/not.c
deleted file mode 100644
index cf7fcba..0000000
--- a/src/arch/x86/opcodes/not.c
+++ /dev/null
@@ -1,97 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_not.c - décodage des négations par complément à un
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'not' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_not_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_NOT_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'not' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_not_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_NOT_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/opcodes.h b/src/arch/x86/opcodes/opcodes.h
deleted file mode 100644
index 84fea64..0000000
--- a/src/arch/x86/opcodes/opcodes.h
+++ /dev/null
@@ -1,685 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * opcodes.h - prototypes pour la liste de tous les opcodes de l'architecture x86
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_OPCODES_OPCODES_H
-#define _ARCH_X86_OPCODES_OPCODES_H
-
-
-#include "../instruction.h"
-#include "../processor.h"
-
-
-
-/* Prototype de décodage d'une instruction x86. */
-typedef GArchInstruction * (* x86_read_instr) (const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-
-
-/* Décode une instruction de type 'adc' (8 bits). */
-GArchInstruction *x86_read_instr_adc_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'adc' (8 bits). */
-GArchInstruction *x86_read_instr_adc_rm8_r8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'adc' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_adc_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'adc' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_adc_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add al, ...' (8 bits). */
-GArchInstruction *x86_read_instr_add_al_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add [e]ax, ...' (16/32 bits). */
-GArchInstruction *x86_read_instr_add_e_ax_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add' (8 bits). */
-GArchInstruction *x86_read_instr_add_r8_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add' (8 bits). */
-GArchInstruction *x86_read_instr_add_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add' (8 bits). */
-GArchInstruction *x86_read_instr_add_rm8_r8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_add_r1632_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_add_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_add_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'add' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_add_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'and al, ...' (8 bits). */
-GArchInstruction *x86_read_instr_and_al_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'and [e]ax, ...' (16/32 bits). */
-GArchInstruction *x86_read_instr_and_e_ax_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'and' (8 bits). */
-GArchInstruction *x86_read_instr_and_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'and' (8 bits). */
-GArchInstruction *x86_read_instr_and_rm8_r8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'and' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_and_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'and' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_and_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'and' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_and_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'arpl' (16 bits). */
-GArchInstruction *x86_read_instr_arpl_rm16_r16(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'call'. */
-GArchInstruction *x86_read_instr_call_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'call' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_call_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cld'. */
-GArchInstruction *x86_read_instr_cld(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (8 bits). */
-GArchInstruction *x86_read_instr_cmp_al_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_cmp_e_ax_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (8 bits). */
-GArchInstruction *x86_read_instr_cmp_r8_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_cmp_r1632_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (8 bits). */
-GArchInstruction *x86_read_instr_cmp_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (8 bits). */
-GArchInstruction *x86_read_instr_cmp_rm8_r8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_cmp_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_cmp_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmp' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_cmp_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'cmps' (8 bits). */
-GArchInstruction *x86_read_instr_cmps_m8_m8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'dec' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_dec_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'dec' (8 bits). */
-GArchInstruction *x86_read_instr_dec_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'dec' (16/32 bits). */
-GArchInstruction *x86_read_instr_dec_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'hlt'. */
-GArchInstruction *x86_read_instr_hlt(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'imul' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_imul_r1632_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'imul' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_imul_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'imul' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_imul_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'inc' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_inc_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'inc' (8 bits). */
-GArchInstruction *x86_read_instr_inc_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'inc' (16/32 bits). */
-GArchInstruction *x86_read_instr_inc_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'int 3'. */
-GArchInstruction *x86_read_instr_int_3(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'int'. */
-GArchInstruction *x86_read_instr_int_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'ja' (saut 8b). */
-GArchInstruction *x86_read_instr_ja_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'ja' (saut 16/32b). */
-GArchInstruction *x86_read_instr_ja_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jb' (saut 8b). */
-GArchInstruction *x86_read_instr_jb_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jb' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jb_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'je' (saut 8b). */
-GArchInstruction *x86_read_instr_je_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'je' (saut 16/32b). */
-GArchInstruction *x86_read_instr_je_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jg' (saut 8b). */
-GArchInstruction *x86_read_instr_jg_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jg' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jg_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jl' (saut 8b). */
-GArchInstruction *x86_read_instr_jl_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jl' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_jl_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jna' (saut 8b). */
-GArchInstruction *x86_read_instr_jna_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jna' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jna_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jnb' (saut 8b). */
-GArchInstruction *x86_read_instr_jnb_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jnb' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jnb_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jne' (saut 8b). */
-GArchInstruction *x86_read_instr_jne_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jne' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jne_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jng' (saut 8b). */
-GArchInstruction *x86_read_instr_jng_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jng' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jng_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jnl' (saut 8b). */
-GArchInstruction *x86_read_instr_jnl_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jnl' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jnl_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jno' (saut 8b). */
-GArchInstruction *x86_read_instr_jno_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jno' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jno_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jnp' (saut 8b). */
-GArchInstruction *x86_read_instr_jnp_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jnp' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jnp_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jns' (saut 8b). */
-GArchInstruction *x86_read_instr_jns_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jns' (saut 16/32b). */
-GArchInstruction *x86_read_instr_jns_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jo' (saut 8b). */
-GArchInstruction *x86_read_instr_jo_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jo' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_jo_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jp' (saut 8b). */
-GArchInstruction *x86_read_instr_jp_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jp' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_jp_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'js' (saut 8b). */
-GArchInstruction *x86_read_instr_js_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'js' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_js_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jump' (petit saut). */
-GArchInstruction *x86_read_instr_jmp_rel8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jmp' (grand saut relatif). */
-GArchInstruction *x86_read_instr_jmp_rel1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'jmp' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_jmp_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'lea' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_lea_r1632_m(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'leave'. */
-GArchInstruction *x86_read_instr_leave(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov al, ...' (8 bits). */
-GArchInstruction *x86_read_instr_mov_al_moffs8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov [e]ax, ...' (16/32 bits). */
-GArchInstruction *x86_read_instr_mov_e_ax_moffs1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov ..., al' (8 bits). */
-GArchInstruction *x86_read_instr_mov_moffs8_al(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov ..., [e]ax' (16/32 bits). */
-GArchInstruction *x86_read_instr_mov_moffs1632_e_ax(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov' (8 bits). */
-GArchInstruction *x86_read_instr_mov_r8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_mov_r1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_mov_r1632_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov' (8 bits). */
-GArchInstruction *x86_read_instr_mov_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_mov_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_mov_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'mov' (8 bits). */
-GArchInstruction *x86_read_instr_mov_rm8_r8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'movs' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_movs_m1632_m1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'movsx' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_movsx_r1632_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'movsx' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_movsx_r1632_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'movzx' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_movzx_r1632_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'movzx' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_movzx_r1632_rm16(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'nop'. */
-GArchInstruction *x86_read_instr_nop(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'not' (8 bits). */
-GArchInstruction *x86_read_instr_not_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'not' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_not_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'or al, ...' (8 bits). */
-GArchInstruction *x86_read_instr_or_al_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'or' (8 bits). */
-GArchInstruction *x86_read_instr_or_r8_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'or' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_or_r1632_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'or' (8 bits). */
-GArchInstruction *x86_read_instr_or_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'or' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_or_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'or' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_or_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'or' (8 bits). */
-GArchInstruction *x86_read_instr_or_rm8_r8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'or' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_or_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'popa'. */
-GArchInstruction *x86_read_instr_popa(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'pop' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_pop_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'push' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_push_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'push' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_push_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'push' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_push_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcl' (8 bits). */
-GArchInstruction *x86_read_instr_rcl_rm8_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcl' (8 bits). */
-GArchInstruction *x86_read_instr_rcl_rm8_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcl' (8 bits). */
-GArchInstruction *x86_read_instr_rcl_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcl' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rcl_rm1632_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcl' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rcl_rm1632_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcl' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rcl_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcr' (8 bits). */
-GArchInstruction *x86_read_instr_rcr_rm8_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcr' (8 bits). */
-GArchInstruction *x86_read_instr_rcr_rm8_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcr' (8 bits). */
-GArchInstruction *x86_read_instr_rcr_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcr' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rcr_rm1632_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcr' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rcr_rm1632_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rcr' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rcr_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'retf'. */
-GArchInstruction *x86_read_instr_retf(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'retf' (16 bits). */
-GArchInstruction *x86_read_instr_retf_imm16(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'retn'. */
-GArchInstruction *x86_read_instr_retn(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'retn' (16 bits). */
-GArchInstruction *x86_read_instr_retn_imm16(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rol' (8 bits). */
-GArchInstruction *x86_read_instr_rol_rm8_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rol' (8 bits). */
-GArchInstruction *x86_read_instr_rol_rm8_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rol' (8 bits). */
-GArchInstruction *x86_read_instr_rol_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rol' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rol_rm1632_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rol' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rol_rm1632_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'rol' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_rol_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'ror' (8 bits). */
-GArchInstruction *x86_read_instr_ror_rm8_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'ror' (8 bits). */
-GArchInstruction *x86_read_instr_ror_rm8_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'ror' (8 bits). */
-GArchInstruction *x86_read_instr_ror_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'ror' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_ror_rm1632_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'ror' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_ror_rm1632_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'ror' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_ror_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sal' (8 bits). */
-#define x86_read_instr_sal_rm8_1 x86_read_instr_shl_rm8_1
-
-/* Décode une instruction de type 'sal' (8 bits). */
-#define x86_read_instr_sal_rm8_cl x86_read_instr_shl_rm8_cl
-
-/* Décode une instruction de type 'sal' (8 bits). */
-#define x86_read_instr_sal_rm8_imm8 x86_read_instr_shl_rm8_imm8
-
-/* Décode une instruction de type 'sal' (16 ou 32 bits). */
-#define x86_read_instr_sal_rm1632_1 x86_read_instr_shl_rm1632_1
-
-/* Décode une instruction de type 'sal' (16 ou 32 bits). */
-#define x86_read_instr_sal_rm1632_cl x86_read_instr_shl_rm1632_cl
-
-/* Décode une instruction de type 'sal' (16 ou 32 bits). */
-#define x86_read_instr_sal_rm1632_1 x86_read_instr_shl_rm1632_1
-
-/* Décode une instruction de type 'sal' (16 ou 32 bits). */
-#define x86_read_instr_sal_rm1632_cl x86_read_instr_shl_rm1632_cl
-
-/* Décode une instruction de type 'sal' (16 ou 32 bits). */
-#define x86_read_instr_sal_rm1632_imm8 x86_read_instr_shl_rm1632_imm8
-
-/* Décode une instruction de type 'sar' (8 bits). */
-GArchInstruction *x86_read_instr_sar_rm8_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sar' (8 bits). */
-GArchInstruction *x86_read_instr_sar_rm8_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sar' (8 bits). */
-GArchInstruction *x86_read_instr_sar_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sar' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_sar_rm1632_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sar' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_sar_rm1632_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sar' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_sar_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sbb' (8 bits). */
-GArchInstruction *x86_read_instr_sbb_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sbb'. */
-GArchInstruction *x86_read_instr_sbb_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sbb' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_sbb_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sbb' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_sbb_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'scas al, ...' (8 bits). */
-GArchInstruction *x86_read_instr_scas_al_m8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'seta' (8 bits). */
-GArchInstruction *x86_read_instr_seta_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setb' (8 bits). */
-GArchInstruction *x86_read_instr_setb_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sete' (8 bits). */
-GArchInstruction *x86_read_instr_sete_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setg' (8 bits). */
-GArchInstruction *x86_read_instr_setg_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setl' (8 bits). */
-GArchInstruction *x86_read_instr_setl_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setna' (8 bits). */
-GArchInstruction *x86_read_instr_setna_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setnb' (8 bits). */
-GArchInstruction *x86_read_instr_setnb_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setne' (8 bits). */
-GArchInstruction *x86_read_instr_setne_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setng' (8 bits). */
-GArchInstruction *x86_read_instr_setng_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setnl' (8 bits). */
-GArchInstruction *x86_read_instr_setnl_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setno' (8 bits). */
-GArchInstruction *x86_read_instr_setno_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setnp' (8 bits). */
-GArchInstruction *x86_read_instr_setnp_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setns' (8 bits). */
-GArchInstruction *x86_read_instr_setns_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'seto' (8 bits). */
-GArchInstruction *x86_read_instr_seto_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'setp' (8 bits). */
-GArchInstruction *x86_read_instr_setp_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sets' (8 bits). */
-GArchInstruction *x86_read_instr_sets_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shl' (8 bits). */
-GArchInstruction *x86_read_instr_shl_rm8_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shl' (8 bits). */
-GArchInstruction *x86_read_instr_shl_rm8_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shl' (8 bits). */
-GArchInstruction *x86_read_instr_shl_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shl' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_shl_rm1632_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shl' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_shl_rm1632_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shl' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_shl_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shr' (8 bits). */
-GArchInstruction *x86_read_instr_shr_rm8_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shr' (8 bits). */
-GArchInstruction *x86_read_instr_shr_rm8_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shr' (8 bits). */
-GArchInstruction *x86_read_instr_shr_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shr' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_shr_rm1632_1(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shr' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_shr_rm1632_cl(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'shr' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_shr_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'stos' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_stos_m1632_e_ax(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sub al, ...' (8 bits). */
-GArchInstruction *x86_read_instr_sub_al_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sub [e]ax, ...' (16/32 bits). */
-GArchInstruction *x86_read_instr_sub_e_ax_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sub' (8 bits). */
-GArchInstruction *x86_read_instr_sub_r8_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sub' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_sub_r1632_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sub' (8 bits). */
-GArchInstruction *x86_read_instr_sub_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sub'. */
-GArchInstruction *x86_read_instr_sub_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sub' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_sub_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'sub' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_sub_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'test al, ...' (8 bits). */
-GArchInstruction *x86_read_instr_test_al_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'test [e]ax, ...' (16/32b). */
-GArchInstruction *x86_read_instr_test_e_ax_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'test' (8 bits). */
-GArchInstruction *x86_read_instr_test_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'test' (8 bits). */
-GArchInstruction *x86_read_instr_test_rm8_r8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'test' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_test_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'test' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_test_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xchg' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_xchg_r1632_e_ax(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor al, ...' (8 bits). */
-GArchInstruction *x86_read_instr_xor_al_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor [e]ax, ...' (16/32 bits). */
-GArchInstruction *x86_read_instr_xor_e_ax_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor' (8 bits). */
-GArchInstruction *x86_read_instr_xor_r8_rm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor' (8 bits). */
-GArchInstruction *x86_read_instr_xor_rm8_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor' (8 bits). */
-GArchInstruction *x86_read_instr_xor_rm8_r8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_xor_r1632_rm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_xor_rm1632_imm8(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_xor_rm1632_imm1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-/* Décode une instruction de type 'xor' (16 ou 32 bits). */
-GArchInstruction *x86_read_instr_xor_rm1632_r1632(const bin_t *, off_t *, off_t, vmpa_t, X86Prefix, const GX86Processor *);
-
-
-
-#endif /* _ARCH_X86_OPCODES_OPCODES_H */
diff --git a/src/arch/x86/opcodes/or.c b/src/arch/x86/opcodes/or.c
deleted file mode 100644
index 98aaf4c..0000000
--- a/src/arch/x86/opcodes/or.c
+++ /dev/null
@@ -1,304 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_or.c - décodage des OU logiques
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'or al, ...' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_or_al_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_OR_AL_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'or' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_or_r8_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_OR_R8_RM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R8, X86_OTP_RM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'or' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_or_r1632_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_OR_R1632_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'or' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_or_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_OR_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'or' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_or_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_OR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'or' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_or_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_OR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'or' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_or_rm8_r8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_OR_RM8_R8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_R8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'or' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_or_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_OR_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/pop.c b/src/arch/x86/opcodes/pop.c
deleted file mode 100644
index 3cb92cf..0000000
--- a/src/arch/x86/opcodes/pop.c
+++ /dev/null
@@ -1,95 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_pop.c - décodage des dépilements
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'pop' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_pop_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- X86Opcodes opcode; /* Instruction effective */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- opcode = XOP_POP_E_AX + (data[*pos] - 0x58);
-
- result = g_x86_instruction_new(opcode);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_OP_R1632, oprsize, 0x58))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'popa'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_popa(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_POPA);
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/push.c b/src/arch/x86/opcodes/push.c
deleted file mode 100644
index 8c9033d..0000000
--- a/src/arch/x86/opcodes/push.c
+++ /dev/null
@@ -1,141 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_push.c - décodage des empilements
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'push' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_push_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_PUSH_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'push' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_push_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- X86Opcodes opcode; /* Instruction effective */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- opcode = XOP_PUSH_E_AX + (data[*pos] - 0x50);
-
- result = g_x86_instruction_new(opcode);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_OP_R1632, oprsize, 0x50))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'push' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_push_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_PUSH_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/rcl.c b/src/arch/x86/opcodes/rcl.c
deleted file mode 100644
index bb2794e..0000000
--- a/src/arch/x86/opcodes/rcl.c
+++ /dev/null
@@ -1,235 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_rcl.c - décodage des rotations à gauche avec retenue
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcl' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcl_rm8_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RCL_RM8_1);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_ONE))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcl' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcl_rm8_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RCL_RM8_CL);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_CL))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcl' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcl_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RCL_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcl' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcl_rm1632_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_RCL_RM1632_1);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_ONE, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcl' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcl_rm1632_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_RCL_RM1632_CL);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_CL, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcl' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcl_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_RCL_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/rcr.c b/src/arch/x86/opcodes/rcr.c
deleted file mode 100644
index fc3195a..0000000
--- a/src/arch/x86/opcodes/rcr.c
+++ /dev/null
@@ -1,235 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_rcr.c - décodage des rotations à droite avec retenue
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcr' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcr_rm8_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RCR_RM8_1);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_ONE))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcr' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcr_rm8_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RCR_RM8_CL);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_CL))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcr' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcr_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RCR_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcr' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcr_rm1632_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_RCR_RM1632_1);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_ONE, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcr' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcr_rm1632_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_RCR_RM1632_CL);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_CL, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rcr' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rcr_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_RCR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/ret.c b/src/arch/x86/opcodes/ret.c
deleted file mode 100644
index f10a438..0000000
--- a/src/arch/x86/opcodes/ret.c
+++ /dev/null
@@ -1,152 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_ret.c - décodage de la sortie d'un appel
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'retf'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_retf(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RETF);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'retf' (16 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_retf_imm16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RETF_IMM16);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_IMM16))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'retn'. *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_retn(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RETN);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* prefix = éventuel(s) préfixe(s) remarqué(s). *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'retn' (16 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_retn_imm16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_RETN_IMM16);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_IMM16))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/rol.c b/src/arch/x86/opcodes/rol.c
deleted file mode 100644
index 8db81a5..0000000
--- a/src/arch/x86/opcodes/rol.c
+++ /dev/null
@@ -1,235 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_rol.c - décodage des rotations à gauche sans retenue
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rol' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rol_rm8_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ROL_RM8_1);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_ONE))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rol' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rol_rm8_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ROL_RM8_CL);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_CL))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rol' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rol_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ROL_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rol' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rol_rm1632_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ROL_RM1632_1);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_ONE, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rol' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rol_rm1632_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ROL_RM1632_CL);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_CL, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'rol' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_rol_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ROL_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/ror.c b/src/arch/x86/opcodes/ror.c
deleted file mode 100644
index 630957e..0000000
--- a/src/arch/x86/opcodes/ror.c
+++ /dev/null
@@ -1,235 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_ror.c - décodage des rotations à droite sans retenue
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'ror' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_ror_rm8_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ROR_RM8_1);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_ONE))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'ror' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_ror_rm8_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ROR_RM8_CL);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_CL))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'ror' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_ror_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_ROR_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'ror' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_ror_rm1632_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ROR_RM1632_1);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_ONE, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'ror' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_ror_rm1632_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ROR_RM1632_CL);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_CL, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'ror' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_ror_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_ROR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/sar.c b/src/arch/x86/opcodes/sar.c
deleted file mode 100644
index a83b6ba..0000000
--- a/src/arch/x86/opcodes/sar.c
+++ /dev/null
@@ -1,235 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_sar.c - décodage des décallages arithmetiques à droite
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sar' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sar_rm8_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SAR_RM8_1);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_ONE))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sar' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sar_rm8_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SAR_RM8_CL);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_CL))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sar' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sar_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SAR_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sar' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sar_rm1632_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SAR_RM1632_1);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_ONE, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sar' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sar_rm1632_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SAR_RM1632_CL);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_CL, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sar' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sar_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SAR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/sbb.c b/src/arch/x86/opcodes/sbb.c
deleted file mode 100644
index bdda930..0000000
--- a/src/arch/x86/opcodes/sbb.c
+++ /dev/null
@@ -1,169 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_sbb.c - décodage des soustractions avec retenue
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sbb' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sbb_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SBB_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sbb' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sbb_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SBB_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sbb' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sbb_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SBB_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sbb' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sbb_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SBB_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/scas.c b/src/arch/x86/opcodes/scas.c
deleted file mode 100644
index bee1584..0000000
--- a/src/arch/x86/opcodes/scas.c
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_scas.c - décodage des recherches dans des chaînes ASCII
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'scas al, ...' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_scas_al_m8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SCAS_AL_M8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_AL/*FIXME*/))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/set.c b/src/arch/x86/opcodes/set.c
deleted file mode 100644
index 1126426..0000000
--- a/src/arch/x86/opcodes/set.c
+++ /dev/null
@@ -1,556 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_set.c - décodage des définitions d'octet sur condition
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'seta' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_seta_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETA_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setb' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setb_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETB_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sete' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sete_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETE_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setg' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setg_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETG_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setl' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setl_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETL_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setna' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setna_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETNA_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setnb' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setnb_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETNB_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setne' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setne_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETNE_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setng' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setng_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETNG_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setnl' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setnl_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETNL_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setno' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setno_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETNO_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setnp' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setnp_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETNP_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setns' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setns_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETNS_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'seto' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_seto_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETO_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'setp' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_setp_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETP_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sets' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sets_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SETS_RM8);
-
- if (!x86_read_one_operand(result, data, pos, len, X86_OTP_RM8))
- {
- g_object_unref(G_OBJECT(result));
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/shl.c b/src/arch/x86/opcodes/shl.c
deleted file mode 100644
index 8892bc0..0000000
--- a/src/arch/x86/opcodes/shl.c
+++ /dev/null
@@ -1,235 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_shl.c - décodage des décallages logiques à gauche
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shl' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shl_rm8_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SHL_RM8_1);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_ONE))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shl' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shl_rm8_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SHL_RM8_CL);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_CL))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shl' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shl_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SHL_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shl' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shl_rm1632_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SHL_RM1632_1);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_ONE, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shl' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shl_rm1632_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SHL_RM1632_CL);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_CL, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shl' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shl_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SHL_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/shr.c b/src/arch/x86/opcodes/shr.c
deleted file mode 100644
index b8cdbff..0000000
--- a/src/arch/x86/opcodes/shr.c
+++ /dev/null
@@ -1,235 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_shr.c - décodage des décallages logiques à droite
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shr' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shr_rm8_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SHR_RM8_1);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_ONE))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shr' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shr_rm8_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SHR_RM8_CL);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_CL))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shr' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shr_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SHR_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shr' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shr_rm1632_1(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SHR_RM1632_1);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_ONE, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shr' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shr_rm1632_cl(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SHR_RM1632_CL);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_CL, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'shr' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_shr_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SHR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/stos.c b/src/arch/x86/opcodes/stos.c
deleted file mode 100644
index 57a280d..0000000
--- a/src/arch/x86/opcodes/stos.c
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_stos.c - décodage des enregistrements de données
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'stos' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_stos_m1632_e_ax(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_STOS_M1632_E_AX);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_DST_1632, X86_OTP_E_AX, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/sub.c b/src/arch/x86/opcodes/sub.c
deleted file mode 100644
index b91d260..0000000
--- a/src/arch/x86/opcodes/sub.c
+++ /dev/null
@@ -1,307 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_sub.c - décodage des soustractions
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sub al, ...' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sub_al_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SUB_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sub [e]ax, ...' (16/32 bits).*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sub_e_ax_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SUB_E_AX_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_E_AX, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sub' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sub_r8_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SUB_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R8, X86_OTP_RM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sub' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sub_r1632_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SUB_R1632_RM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sub' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sub_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_SUB_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sub' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sub_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SUB_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sub' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sub_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SUB_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'sub' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_sub_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_SUB_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/test.c b/src/arch/x86/opcodes/test.c
deleted file mode 100644
index bc964a3..0000000
--- a/src/arch/x86/opcodes/test.c
+++ /dev/null
@@ -1,235 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_test.c - décodage des comparaisons logiques
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'test al, ...' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_test_al_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_TEST_AL_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'test [e]ax, ...' (16/32b). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_test_e_ax_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_TEST_E_AX_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_E_AX, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'test' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_test_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_TEST_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'test' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_test_rm8_r8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_TEST_RM8_R8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_R8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'test' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_test_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_TEST_RM1632_IMM1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* offset = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'test' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_test_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_TEST_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/xchg.c b/src/arch/x86/opcodes/xchg.c
deleted file mode 100644
index fdbc915..0000000
--- a/src/arch/x86/opcodes/xchg.c
+++ /dev/null
@@ -1,67 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_xchg.c - décodage des échanges de contenu de regitres
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xchg' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xchg_r1632_e_ax(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- X86Opcodes opcode; /* Instruction effective */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- opcode = XOP_XCHG_R1632_E_AX + (data[*pos] - 0x90);
-
- result = g_x86_instruction_new(opcode);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_OP_R1632, X86_OTP_E_AX, oprsize, 0x90))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/opcodes/xor.c b/src/arch/x86/opcodes/xor.c
deleted file mode 100644
index e38ff49..0000000
--- a/src/arch/x86/opcodes/xor.c
+++ /dev/null
@@ -1,340 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * op_xor.c - décodage des OU exclusifs
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes.h"
-
-
-#include "../operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor al, ...' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_al_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_XOR_AL_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_AL, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor [e]ax, ...' (16/32 bits).*
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_e_ax_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_XOR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_E_AX, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_r8_rm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_XOR_R8_RM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R8, X86_OTP_RM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_rm8_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_XOR_RM8_IMM8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_IMM8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor' (8 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_rm8_r8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
-
- result = g_x86_instruction_new(XOP_XOR_RM8_R8);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM8, X86_OTP_R8))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_r1632_rm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_XOR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_R1632, X86_OTP_RM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_rm1632_imm8(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_XOR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM8, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_rm1632_imm1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_XOR_RM1632_IMM8);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_IMM1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* proc = architecture ciblée par le désassemblage. *
-* *
-* Description : Décode une instruction de type 'xor' (16 ou 32 bits). *
-* *
-* Retour : Instruction mise en place ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *x86_read_instr_xor_rm1632_r1632(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, X86Prefix prefix, const GX86Processor *proc)
-{
- GArchInstruction *result; /* Instruction à retourner */
- MemoryDataSize oprsize; /* Taille des opérandes */
-
- result = g_x86_instruction_new(XOP_XOR_RM1632_R1632);
-
- oprsize = g_x86_processor_get_operand_size(proc, prefix);
-
- if (!x86_read_two_operands(result, data, pos, len, X86_OTP_RM1632, X86_OTP_R1632, oprsize))
- {
- /* TODO free(result);*/
- return NULL;
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/operand.c b/src/arch/x86/operand.c
deleted file mode 100644
index c83cbfa..0000000
--- a/src/arch/x86/operand.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * operand.c - gestion des operandes de l'architecture x86
- *
- * Copyright (C) 2008-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "operand.h"
-
-
-
-/******************************************************************************
-* *
-* Paramètres : instr = instruction dont la définition est à compléter. [OUT]*
-* data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* count = quantité d'opérandes à lire. *
-* ... = éventuelle(s) information(s) complémentaire(s). *
-* *
-* Description : Procède à la lecture de trois opérandes donnés. *
-* *
-* Retour : Bilan de l'opération : true en cas de succès, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool _x86_read_operands(GArchInstruction *instr, const bin_t *data, off_t *pos, off_t len, unsigned int count, ...)
-{
- bool result; /* Bilan à retourner */
- va_list ap; /* Liste des compléments */
- X86OperandType types[MAX_OPERANDS]; /* Type des opérandes */
- unsigned int i; /* Boucle de parcours */
- bool op1_first; /* Position de l'opérande #1 */
- bool op2_first; /* Position de l'opérande #2 */
- MemoryDataSize oprsize; /* Taille des opérandes */
- off_t op_pos[MAX_OPERANDS]; /* Position après lecture */
- vmpa_t offset; /* Adresse courante */
- bin_t base; /* Indice du premier registre */
- GArchOperand *op; /* Opérande unique décodé */
-
- if (count > MAX_OPERANDS) return false;
-
- result = true;
-
- va_start(ap, count);
-
- /* Types à charger */
-
- for (i = 0; i < count; i++)
- types[i] = va_arg(ap, MemoryDataSize);
-
- for ( ; i < MAX_OPERANDS; i++)
- types[i] = X86_OTP_NONE;
-
- /* Initialisations */
-
- if (types[0] & X86_OTP_RM_TYPE)
- {
- op1_first = true;
- op2_first = false;
- }
- else if (types[1] & X86_OTP_RM_TYPE)
- {
- op1_first = false;
- op2_first = true;
- }
- else
- {
- op1_first = true;
- op2_first = false;
- }
-
- oprsize = MDS_UNDEFINED;
-
- /* Lecture des opérandes */
-
- for (i = 0; i < count && result; i++)
- {
- /* Tête de lecture */
- switch (i)
- {
- case 0:
- op_pos[0] = *pos;
- break;
-
- case 1:
- if ((types[0] & X86_OTP_REG_TYPE || types[0] & X86_OTP_RM_TYPE) && (types[1] & X86_OTP_IMM_TYPE))
- op_pos[1] = op_pos[0];
- else op_pos[1] = *pos;
- *pos = op_pos[0];
- break;
-
- case 2 ... MAX_OPERANDS:
- *pos = MAX(*pos, op_pos[i - 1]);
- op_pos[i] = *pos;
-
- }
-
- /* Lecture */
- switch (types[i])
- {
- case X86_OTP_IMM8:
- assert(0);
- //op = g_imm_operand_new_from_data_old(MDS_8_BITS, data, &op_pos[i], len, SRE_LITTLE /* FIXME */);
- break;
-
- case X86_OTP_IMM16:
- assert(0);
- //op = g_imm_operand_new_from_data_old(MDS_16_BITS, data, &op_pos[i], len, SRE_LITTLE /* FIXME */);
- break;
-
- case X86_OTP_IMM1632:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- assert(0);
- //op = g_imm_operand_new_from_data_old(oprsize == MDS_32_BITS ? MDS_32_BITS : MDS_16_BITS, data, &op_pos[i], len, SRE_LITTLE /* FIXME */);
- break;
-
- case X86_OTP_MOFFS8:
- op = g_x86_moffs_operand_new(data, &op_pos[i], len, MDS_8_BITS);
- break;
-
- case X86_OTP_MOFFS1632:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- op = g_x86_moffs_operand_new(data, &op_pos[i], len, oprsize);
- break;
-
- case X86_OTP_REL8:
- offset = va_arg(ap, vmpa_t);
- op = g_x86_relative_operand_new(data, &op_pos[i], len, MDS_8_BITS, offset + 1);
- break;
-
- case X86_OTP_REL1632:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- offset = va_arg(ap, vmpa_t);
- op = g_x86_relative_operand_new(data, &op_pos[i], len, oprsize, offset + 1);
- break;
-
- case X86_OTP_R8:
- op = g_x86_register_operand_new_from_mod_rm(data, &op_pos[i], len, MDS_8_BITS, i == 0 ? op1_first : op2_first);
- break;
-
- case X86_OTP_R1632:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- op = g_x86_register_operand_new_from_mod_rm(data, &op_pos[i], len, oprsize, i == 0 ? op1_first : op2_first);
- break;
-
- case X86_OTP_OP_R8:
- base = (bin_t)va_arg(ap, int);
- op = g_x86_register_operand_new_from_opcode(data, &op_pos[i], len, MDS_8_BITS, base);
- break;
-
- case X86_OTP_OP_R1632:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- base = (bin_t)va_arg(ap, int);
- op = g_x86_register_operand_new_from_opcode(data, &op_pos[i], len, oprsize, base);
- break;
-
- case X86_OTP_RM8:
- op = g_x86_mod_rm_operand_new(data, &op_pos[i], len, MDS_8_BITS);
- break;
-
- case X86_OTP_RM16:
- op = g_x86_mod_rm_operand_new(data, &op_pos[i], len, MDS_16_BITS);
- break;
-
- case X86_OTP_RM1632:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- op = g_x86_mod_rm_operand_new(data, &op_pos[i], len, oprsize);
- break;
-
- case X86_OTP_DST_8:
- op = g_x86_data_operand_new(MDS_8_BITS, true);
- break;
-
- case X86_OTP_DST_1632:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- op = g_x86_data_operand_new(oprsize == MDS_32_BITS ? MDS_32_BITS : MDS_16_BITS, true);
- break;
-
- case X86_OTP_SRC_8:
- op = g_x86_data_operand_new(MDS_8_BITS, false);
- break;
-
- case X86_OTP_SRC_1632:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- op = g_x86_data_operand_new(oprsize == MDS_32_BITS ? MDS_32_BITS : MDS_16_BITS, false);
- break;
-
- case X86_OTP_ONE:
- op = g_imm_operand_new_from_value(MDS_8_BITS, 1);
- break;
-
- case X86_OTP_CL:
- op = g_x86_register_operand_new_from_index(0x01, MDS_8_BITS);
- break;
-
- case X86_OTP_AL:
- op = g_x86_register_operand_new_from_index(0x00, MDS_8_BITS);
- break;
-
- case X86_OTP_E_AX:
- if (oprsize == MDS_UNDEFINED) oprsize = va_arg(ap, MemoryDataSize);
- op = g_x86_register_operand_new_from_index(0x00, oprsize);
- break;
-
- }
-
- if (op == NULL) result = false;
- else g_arch_instruction_attach_extra_operand(instr, op);
-
- }
-
- *pos = MAX(*pos, op_pos[i - 1]);
-
- return result;
-
-}
diff --git a/src/arch/x86/operand.h b/src/arch/x86/operand.h
deleted file mode 100644
index a3685f4..0000000
--- a/src/arch/x86/operand.h
+++ /dev/null
@@ -1,100 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * operand.h - prototypes pour la gestion des operandes de l'architecture x86
- *
- * Copyright (C) 2008-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_OPERAND_H
-#define _ARCH_X86_OPERAND_H
-
-
-#include <stdbool.h>
-
-
-#include "operands/data.h"
-#include "operands/modrm.h"
-#include "operands/moffs.h"
-#include "operands/register.h"
-#include "operands/relative.h"
-#include "../instruction.h"
-
-
-
-/* Construction d'identifiants typés */
-
-#define X86_OTP_IMM_TYPE 0x8000
-#define X86_OTP_REG_TYPE 0x4000
-#define X86_OTP_RM_TYPE 0x2000
-#define X86_OTP_DATA_TYPE 0x1000
-
-#define X86_OTP_IMM(b) X86_OTP_IMM_TYPE | (1 << b)
-#define X86_OTP_REG(b) X86_OTP_REG_TYPE | (1 << b)
-#define X86_OTP_RM(b) X86_OTP_RM_TYPE | (1 << b)
-#define X86_OTP_DATA(b) X86_OTP_DATA_TYPE | (1 << b)
-
-/* Types d'opérandes supportés */
-typedef enum _X86OperandType
-{
- X86_OTP_NONE = 0, /* Aucun opérande de prévu */
-
- X86_OTP_IMM8 = X86_OTP_IMM(1), /* Valeur immédiate sur 8 bits */
- X86_OTP_IMM16 = X86_OTP_IMM(2), /* Valeur immédiate sur 16b */
- X86_OTP_IMM1632 = X86_OTP_IMM(3), /* Valeur immédiate sur 16/32b */
- X86_OTP_MOFFS8 = X86_OTP_IMM(4), /* Décallage immédiat 8 bits */
- X86_OTP_MOFFS1632 = X86_OTP_IMM(5), /* Décallage immédiat 16/32b */
- X86_OTP_REL8 = X86_OTP_IMM(6), /* Adresse relative 8 bits */
- X86_OTP_REL1632 = X86_OTP_IMM(7), /* Adresse relative 16/32 bits */
-
- X86_OTP_R8 = X86_OTP_REG(1), /* Registre 8 bits */
- X86_OTP_R1632 = X86_OTP_REG(2), /* Registre 16 ou 32 bits */
- X86_OTP_OP_R8 = X86_OTP_REG(3), /* Registre 8 bits */
- X86_OTP_OP_R1632 = X86_OTP_REG(4), /* Registre 16 ou 32 bits */
-
- X86_OTP_RM8 = X86_OTP_RM(1), /* Registre 8 bits ou mémoire */
- X86_OTP_RM16 = X86_OTP_RM(2), /* Registre 16 bits ou mémoire */
- X86_OTP_RM1632 = X86_OTP_RM(3), /* Registre 16/32b ou mémoire */
-
- X86_OTP_DST_8 = X86_OTP_DATA(1), /* Emplacement sur 8 bits */
- X86_OTP_DST_1632 = X86_OTP_DATA(2), /* Emplacement sur 16/32 bits */
- X86_OTP_SRC_8 = X86_OTP_DATA(3), /* Emplacement sur 8 bits */
- X86_OTP_SRC_1632 = X86_OTP_DATA(4), /* Emplacement sur 16/32 bits */
-
- X86_OTP_ONE = 0x0ffc, /* Valeur immédiate "1" */
- X86_OTP_CL = 0x0ffd, /* Registre cl */
- X86_OTP_AL = 0x0ffe, /* Registre al */
- X86_OTP_E_AX = 0x0fff /* Registre eax ou ax */
-
-} X86OperandType;
-
-
-/* Nombre maximal d'opérande */
-#define MAX_OPERANDS 3
-
-
-#define x86_read_one_operand(instr, data, pos, len, ...) _x86_read_operands(instr, data, pos, len, 1, __VA_ARGS__)
-#define x86_read_two_operands(instr, data, pos, len, ...) _x86_read_operands(instr, data, pos, len, 2, __VA_ARGS__)
-#define x86_read_three_operands(instr, data, pos, len, ...) _x86_read_operands(instr, data, pos, len, 3, __VA_ARGS__)
-
-/* Procède à la lecture de n opérandes donnés. */
-bool _x86_read_operands(GArchInstruction *, const bin_t *, off_t *, off_t, unsigned int, ...);
-
-
-
-#endif /* _ARCH_X86_OPERAND_H */
diff --git a/src/arch/x86/operands/Makefile.am b/src/arch/x86/operands/Makefile.am
deleted file mode 100644
index e04270a..0000000
--- a/src/arch/x86/operands/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-
-noinst_LTLIBRARIES = libarchx86operands.la
-
-libarchx86operands_la_SOURCES = \
- data.h data.c \
- modrm.h modrm.c \
- moffs.h moffs.c \
- register.h register.c \
- relative.h relative.c
-
-libarchx86_la_CFLAGS = $(AM_CFLAGS)
-
-
-AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
-
-AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-
-
-SUBDIRS =
diff --git a/src/arch/x86/operands/data.c b/src/arch/x86/operands/data.c
deleted file mode 100644
index ef03381..0000000
--- a/src/arch/x86/operands/data.c
+++ /dev/null
@@ -1,197 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * data.c - opérandes de manipulation de données
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "data.h"
-
-
-#include "../register.h"
-#include "../../operand-int.h"
-
-
-
-/* Définition d'un opérande x86 de manipulation de données (instance) */
-struct _GX86DataOperand
-{
- GArchOperand parent; /* Instance parente */
-
- GX86Register *reg; /* Registre représenté */
- bool dest; /* Déduction du type de segment*/
-
-};
-
-/* Définition d'un opérande x86 de manipulation de données (classe) */
-struct _GX86DataOperandClass
-{
- GArchOperandClass parent; /* Classe parente */
-
-};
-
-
-/* Initialise la classe des opérandes x86 pointant des données. */
-static void g_x86_data_operand_class_init(GX86DataOperandClass *);
-
-/* Initialise une instance d'opérande x86 pointant des données. */
-static void g_x86_data_operand_init(GX86DataOperand *);
-
-
-
-/* Indique le type défini par la GLib pour un opérande x86 de manipulation de données. */
-G_DEFINE_TYPE(GX86DataOperand, g_x86_data_operand, G_TYPE_ARCH_OPERAND);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des opérandes x86 pointant des données. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_data_operand_class_init(GX86DataOperandClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = instance à initialiser. *
-* *
-* Description : Initialise une instance d'opérande pointant des données. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_data_operand_init(GX86DataOperand *operand)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : size = taille de l'opérande, et donc du registre. *
-* dest = indique si la cible est une destination ou une source.*
-* *
-* Description : Crée un opérande x86 de manipulation de données. *
-* *
-* Retour : Opérande mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchOperand *g_x86_data_operand_new(MemoryDataSize size, bool dest)
-{
- GX86DataOperand *result; /* Structure à retourner */
-
- result = g_object_new(G_TYPE_X86_DATA_OPERAND, NULL);
-
- result->reg = g_x86_register_new(MDS_32_BITS/* FIXME size*/, dest ? 0x07 : 0x06);
- result->dest = dest;
-
- return G_ARCH_OPERAND(result);
-
-}
-
-
-#if 0
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à transcrire. *
-* options = options de rendu. *
-* rendering = support effectif final des lignes de code. *
-* stream = flux ouvert en écriture. *
-* *
-* Description : Ajoute du texte simple à un fichier ouvert en écriture. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_data_operand_add_text(const GX86DataOperand *operand, GRenderingOptions *options, MainRendering rendering, FILE *stream)
-{
- GContentExporter *exporter; /* Autre vision de l'opérande */
-
- exporter = G_CONTENT_EXPORTER(operand);
-
- if (operand->dest)
- g_content_exporter_insert_text(exporter, stream, "es:", 3, RTT_SEGMENT);
- else
- g_content_exporter_insert_text(exporter, stream, "ds:", 3, RTT_SEGMENT);
-
- g_content_exporter_insert_text(exporter, stream, "[", 1, RTT_HOOK);
-
- g_content_exporter_add_text(G_CONTENT_EXPORTER(operand->reg), options, rendering, stream);
-
- g_content_exporter_insert_text(exporter, stream, "]", 1, RTT_HOOK);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à transcrire. *
-* buffer = espace où placer ledit contenu. *
-* options = options de rendu. *
-* *
-* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_data_operand_to_buffer(const GX86DataOperand *operand, GBufferLine *buffer, GRenderingOptions *options)
-{
- GContentExporter *exporter; /* Autre vision de l'opérande */
-
- exporter = G_CONTENT_EXPORTER(operand);
-
- if (operand->dest)
- g_content_exporter_insert_into_buffer(G_CONTENT_EXPORTER(operand), buffer, BLC_ASSEMBLY,
- "es:", 3, RTT_SEGMENT);
- else
- g_content_exporter_insert_into_buffer(G_CONTENT_EXPORTER(operand), buffer, BLC_ASSEMBLY,
- "ds:", 3, RTT_SEGMENT);
-
- g_content_exporter_insert_into_buffer(G_CONTENT_EXPORTER(operand), buffer, BLC_ASSEMBLY,
- "[", 1, RTT_HOOK);
-
- g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->reg), buffer, options);
-
- g_content_exporter_insert_into_buffer(G_CONTENT_EXPORTER(operand), buffer, BLC_ASSEMBLY,
- "]", 1, RTT_HOOK);
-
-}
-#endif
diff --git a/src/arch/x86/operands/data.h b/src/arch/x86/operands/data.h
deleted file mode 100644
index fda4ba0..0000000
--- a/src/arch/x86/operands/data.h
+++ /dev/null
@@ -1,60 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * data.h - prototypes pour les opérandes de manipulation de données
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_OPERANDS_DATA_H
-#define _ARCH_X86_OPERANDS_DATA_H
-
-
-#include <glib-object.h>
-
-
-#include "../../operand.h"
-#include "../../../common/endianness.h"
-
-
-
-#define G_TYPE_X86_DATA_OPERAND g_x86_data_operand_get_type()
-#define G_X86_DATA_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_x86_data_operand_get_type(), GX86DataOperand))
-#define G_IS_X86_DATA_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_x86_data_operand_get_type()))
-#define G_X86_DATA_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_X86_DATA_OPERAND, GX86DataOperandClass))
-#define G_IS_X86_DATA_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_X86_DATA_OPERAND))
-#define G_X86_DATA_OPERAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_X86_DATA_OPERAND, GX86DataOperandClass))
-
-
-
-/* Définition d'un opérande x86 de manipulation de données (instance) */
-typedef struct _GX86DataOperand GX86DataOperand;
-
-/* Définition d'un opérande x86 de manipulation de données (classe) */
-typedef struct _GX86DataOperandClass GX86DataOperandClass;
-
-
-/* Indique le type défini par la GLib pour un opérande x86 de manipulation de données. */
-GType g_x86_data_operand_get_type(void);
-
-/* Crée un opérande x86 de manipulation de données. */
-GArchOperand *g_x86_data_operand_new(MemoryDataSize, bool);
-
-
-
-#endif /* _ARCH_X86_OPERANDS_DATA_H */
diff --git a/src/arch/x86/operands/modrm.c b/src/arch/x86/operands/modrm.c
deleted file mode 100644
index f48fe28..0000000
--- a/src/arch/x86/operands/modrm.c
+++ /dev/null
@@ -1,430 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * modrm.c - opérandes de type mod/rm
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "modrm.h"
-
-
-#include <math.h>
-
-
-#include "register.h"
-#include "../../operand-int.h"
-
-
-
-/* Définition d'un opérande x86 de type ModRM (instance) */
-struct _GX86ModRMOperand
-{
- GArchOperand parent; /* Instance parente */
-
- uint8_t scale; /* Puissance de deux */
- GX86Register *index; /* Registre servant d'indice */
- GX86Register *base; /* Registre de base */
- GImmOperand *displacement; /* Décallage supplémentaire */
-
-};
-
-
-/* Définition d'un opérande x86 de type ModRM (classe) */
-struct _GX86ModRMOperandClass
-{
- GArchOperandClass parent; /* Classe parente */
-
-};
-
-
-/* Initialise la classe des opérandes x86 de type ModRM. */
-static void g_x86_mod_rm_operand_class_init(GX86ModRMOperandClass *);
-
-/* Initialise une instance d'opérande x86 de type ModRM. */
-static void g_x86_mod_rm_operand_init(GX86ModRMOperand *);
-
-
-
-/* Indique le type défini par la GLib pour un opérande x86 de type ModRM. */
-G_DEFINE_TYPE(GX86ModRMOperand, g_x86_mod_rm_operand, G_TYPE_ARCH_OPERAND);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des opérandes x86 de type ModRM. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_mod_rm_operand_class_init(GX86ModRMOperandClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = instance à initialiser. *
-* *
-* Description : Initialise une instance d'opérande x86 de type ModRM. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_mod_rm_operand_init(GX86ModRMOperand *operand)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* size = taille de l'opérande, et donc du registre. *
-* *
-* Description : Crée un opérande x86 de type ModRM. *
-* *
-* Retour : Opérande mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchOperand *g_x86_mod_rm_operand_new(const bin_t *data, off_t *pos, off_t len, MemoryDataSize size)
-{
- GX86ModRMOperand *result; /* Structure à retourner */
- uint8_t mod; /* Modificateur présent */
- GX86Register *reg; /* Registre lu */
-
- mod = (data[*pos] & 0xc0);
-
- if (mod == 0xc0)
- return g_x86_register_operand_new_from_mod_rm(data, pos, len, size, true);
-
- reg = g_x86_register_new(size, data[*pos] & 0x07);
- if (reg == NULL) return NULL;
-
- (*pos)++;
-
- /* Vieille astuce de l'emplacement mémoire fixe ? */
- if (g_x86_register_is_base_pointer(reg) && mod == 0x00)
- {
- /* FIXME *///free_x86_register(reg);
- assert(0);
- return NULL;
- //return g_imm_operand_new_from_data_old(MDS_32_BITS/* FIXME */, data, pos, len, SRE_LITTLE /*FIXME*/);
- }
-
- result = g_object_new(G_TYPE_X86_MOD_RM_OPERAND, NULL);
-
- /* A la recherche d'un SIB */
- if (g_x86_register_is_stack_pointer(reg))
- {
- /* FIXME *///free_x86_register(reg);
-
- result->base = g_x86_register_new(size, data[*pos] & 0x07);
- if (result->base == NULL) goto gxmron_error;
-
- result->index = g_x86_register_new(size, (data[*pos] & 0x38) >> 3);
- if (result->index == NULL) goto gxmron_error;
-
- result->scale = ((data[*pos] & 0xc0) >> 6);
-
- if (g_x86_register_is_stack_pointer(result->index))
- {
- /* FIXME *///free_x86_register(result->index);
- result->index = result->base;
- result->base = NULL;
- }
-
- (*pos)++;
-
- }
-
- else result->index = reg;
-
- /* Décallage supplémentaire ? */
- switch (mod)
- {
- case 0x00:
- if (result->base != NULL && g_x86_register_is_base_pointer(result->base))
- {
- /* FIXME *///free_x86_register(result->base);
- result->base = NULL;
-
- assert(0);
- //result->displacement = g_imm_operand_new_from_data_old(size/* FIXME : !convert mds/aos */, data, pos, len, SRE_LITTLE /* FIXME */);
- if (result->displacement == NULL) goto gxmron_error;
-
- }
- break;
-
- case 0x40:
- assert(0);
- //result->displacement = g_imm_operand_new_from_data_old(MDS_8_BITS_SIGNED, data, pos, len, SRE_LITTLE /* FIXME */);
- if (result->displacement == NULL) goto gxmron_error;
- break;
-
- case 0x80:
- assert(0);
- //result->displacement = g_imm_operand_new_from_data_old(MDS_32_BITS_SIGNED/* FIXME ! 16/32 */, data, pos, len, SRE_LITTLE /* FIXME */);
- if (result->displacement == NULL) goto gxmron_error;
- break;
-
- }
-
- return G_ARCH_OPERAND(result);
-
- gxmron_error:
-
- /* FIXME free(result);*/
- return NULL;
-
-}
-
-#if 0
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à transcrire. *
-* options = options de rendu. *
-* rendering = support effectif final des lignes de code. *
-* stream = flux ouvert en écriture. *
-* *
-* Description : Ajoute du texte simple à un fichier ouvert en écriture. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_mod_rm_operand_add_text(const GX86ModRMOperand *operand, GRenderingOptions *options, MainRendering rendering, FILE *stream)
-{
- GContentExporter *exporter; /* Autre vision de l'opérande */
- char tmp[2]; /* Echelle en puissance de 2 */
-
- exporter = G_CONTENT_EXPORTER(operand);
-
- switch (g_rendering_options_get_syntax(options))
- {
- case ASX_INTEL:
-
- g_content_exporter_insert_text(exporter, stream, "[", 1, RTT_HOOK);
-
- if (operand->scale > 0)
- {
- snprintf(tmp, 2, "%d", (int)pow(2, operand->scale));
-
- g_content_exporter_insert_text(exporter, stream, tmp, 1, RTT_IMMEDIATE);
-
- g_content_exporter_insert_text(exporter, stream, "*", 1, RTT_SIGNS);
-
- }
-
- g_content_exporter_add_text(G_CONTENT_EXPORTER(operand->index),
- options, rendering, stream);
-
- if (operand->base != NULL)
- {
- g_content_exporter_insert_text(exporter, stream, "+", 1, RTT_SIGNS);
-
- g_content_exporter_add_text(G_CONTENT_EXPORTER(operand->base),
- options, rendering, stream);
-
- }
-
- if (operand->displacement != NULL)
- {
- if (g_imm_operand_is_negative(operand->displacement))
- g_content_exporter_insert_text(exporter, stream, "-", 1, RTT_SIGNS);
- else
- g_content_exporter_insert_text(exporter, stream, "+", 1, RTT_SIGNS);
-
- g_content_exporter_add_text(G_CONTENT_EXPORTER(operand->displacement),
- options, rendering, stream);
-
- }
-
- g_content_exporter_insert_text(exporter, stream, "]", 1, RTT_HOOK);
-
- break;
-
- case ASX_ATT:
-
- /* TODO */
- g_content_exporter_insert_text(exporter, stream, "[ModRM]", 7, RTT_HOOK);
-
- break;
-
- }
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à transcrire. *
-* buffer = espace où placer ledit contenu. *
-* options = options de rendu. *
-* *
-* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_mod_rm_operand_to_buffer(const GX86ModRMOperand *operand, GBufferLine *buffer, GRenderingOptions *options)
-{
- GContentExporter *exporter; /* Autre vision de l'opérande */
- char tmp[2]; /* Echelle en puissance de 2 */
-
- exporter = G_CONTENT_EXPORTER(operand);
-
- switch (g_rendering_options_get_syntax(options))
- {
- case ASX_INTEL:
-
- g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ASSEMBLY,
- "[", 1, RTT_HOOK);
-
- if (operand->scale > 0)
- {
- snprintf(tmp, 2, "%d", (int)pow(2, operand->scale));
-
- g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ASSEMBLY,
- tmp, 1, RTT_IMMEDIATE);
-
- g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ASSEMBLY,
- "*", 1, RTT_SIGNS);
-
- }
-
- g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->index), buffer, options);
-
- if (operand->base != NULL)
- {
- g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ASSEMBLY,
- "+", 1, RTT_SIGNS);
-
- g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->base), buffer, options);
-
- }
-
- if (operand->displacement != NULL)
- {
- if (g_imm_operand_is_negative(operand->displacement))
- g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ASSEMBLY,
- "-", 1, RTT_SIGNS);
- else
- g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ASSEMBLY,
- "+", 1, RTT_SIGNS);
-
- g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->displacement), buffer, options);
-
- }
-
- g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ASSEMBLY,
- "]", 1, RTT_HOOK);
-
- break;
-
- case ASX_ATT:
-
- /* TODO */
- g_content_exporter_insert_into_buffer(exporter, buffer, BLC_ASSEMBLY,
- "[ModRM]", 7, RTT_HOOK);
-
- break;
-
- }
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à consulter. *
-* scale = facteur sous forme de puissance de deux. [OUT *
-* index = register principal de l'opérande. [OUT] *
-* *
-* Description : Fournit l'indice et l'échelle d'un opérande x86 ModRM. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_x86_mod_rm_operand_get_scale_and_index(const GX86ModRMOperand *operand, uint8_t *scale, const GX86Register **index)
-{
- *scale = operand->scale;
- *index = operand->index;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à consulter. *
-* *
-* Description : Fournit le registre de base d'un opérande x86 ModRM. *
-* *
-* Retour : Registre de base de l'opérande. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-const GX86Register *g_x86_mod_rm_operand_get_base(const GX86ModRMOperand *operand)
-{
- return operand->base;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à consulter. *
-* *
-* Description : Fournit le décallage supplémentaire d'un opérande x86 ModRM. *
-* *
-* Retour : Décallage numérique pour l'opérande. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-const GImmOperand *g_x86_mod_rm_operand_get_displacement(const GX86ModRMOperand *operand)
-{
- return operand->displacement;
-
-}
diff --git a/src/arch/x86/operands/modrm.h b/src/arch/x86/operands/modrm.h
deleted file mode 100644
index e424010..0000000
--- a/src/arch/x86/operands/modrm.h
+++ /dev/null
@@ -1,70 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * modrm.h - prototypes pour les opérandes de type mod/rm
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_OPERANDS_MODRM_H
-#define _ARCH_X86_OPERANDS_MODRM_H
-
-
-#include <glib-object.h>
-
-
-#include "../register.h"
-#include "../../immediate.h"
-#include "../../operand.h"
-#include "../../../common/endianness.h"
-
-
-
-#define G_TYPE_X86_MOD_RM_OPERAND g_x86_mod_rm_operand_get_type()
-#define G_X86_MOD_RM_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_x86_mod_rm_operand_get_type(), GX86ModRMOperand))
-#define G_IS_X86_MOD_RM_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_x86_mod_rm_operand_get_type()))
-#define G_X86_MOD_RM_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_X86_MOD_RM_OPERAND, GX86ModRMOperandClass))
-#define G_IS_X86_MOD_RM_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_X86_MOD_RM_OPERAND))
-#define G_X86_MOD_RM_OPERAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_X86_MOD_RM_OPERAND, GX86ModRMOperandClass))
-
-
-/* Définition d'un opérande x86 de type ModRM (instance) */
-typedef struct _GX86ModRMOperand GX86ModRMOperand;
-
-/* Définition d'un opérande x86 de type ModRM (classe) */
-typedef struct _GX86ModRMOperandClass GX86ModRMOperandClass;
-
-
-/* Indique le type défini par la GLib pour un opérande x86 de type ModRM. */
-GType g_x86_mod_rm_operand_get_type(void);
-
-/* Crée un opérande x86 de type ModRM. */
-GArchOperand *g_x86_mod_rm_operand_new(const bin_t *, off_t *, off_t, MemoryDataSize);
-
-/* Fournit l'indice et l'échelle d'un opérande x86 ModRM. */
-void g_x86_mod_rm_operand_get_scale_and_index(const GX86ModRMOperand *operand, uint8_t *, const GX86Register **);
-
-/* Fournit le registre de base d'un opérande x86 ModRM. */
-const GX86Register *g_x86_mod_rm_operand_get_base(const GX86ModRMOperand *);
-
-/* Fournit le décallage supplémentaire d'un opérande x86 ModRM. */
-const GImmOperand *g_x86_mod_rm_operand_get_displacement(const GX86ModRMOperand *);
-
-
-
-#endif /* _ARCH_X86_OPERANDS_MODRM_H */
diff --git a/src/arch/x86/operands/moffs.c b/src/arch/x86/operands/moffs.c
deleted file mode 100644
index 4df00d5..0000000
--- a/src/arch/x86/operands/moffs.c
+++ /dev/null
@@ -1,180 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * moffs.c - opérandes d'emplacements mémoire
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "moffs.h"
-
-
-#include "../../immediate.h"
-#include "../../operand-int.h"
-
-
-
-/* Définition d'un opérande visant un emplacement mémoire x86 (instance) */
-struct _GX86MOffsOperand
-{
- GArchOperand parent; /* Instance parente */
-
- GImmOperand *offset; /* Adresse mémoire visée */
-
-};
-
-/* Définition d'un opérande visant un emplacement mémoire x86 (classe) */
-struct _GX86MOffsOperandClass
-{
- GArchOperandClass parent; /* Classe parente */
-
-};
-
-
-/* Initialise la classe des opérandes d'emplacement mémoire x86. */
-static void g_x86_moffs_operand_class_init(GX86MOffsOperandClass *);
-
-/* Initialise une instance d'opérande d'emplacement mémoire x86. */
-static void g_x86_moffs_operand_init(GX86MOffsOperand *);
-
-
-
-/* Indique le type défini par la GLib pour un opérande d'emplacement mémoire x86. */
-G_DEFINE_TYPE(GX86MOffsOperand, g_x86_moffs_operand, G_TYPE_ARCH_OPERAND);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des opérandes d'emplacement mémoire x86.*
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_moffs_operand_class_init(GX86MOffsOperandClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = instance à initialiser. *
-* *
-* Description : Initialise une instance d'opérande d'emplacement mémoire x86.*
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_moffs_operand_init(GX86MOffsOperand *operand)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* size = taille de l'opérande, et donc du registre. *
-* *
-* Description : Crée un opérande d'emplacement mémoire x86. *
-* *
-* Retour : Opérande mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchOperand *g_x86_moffs_operand_new(const bin_t *data, off_t *pos, off_t len, MemoryDataSize size)
-{
- GX86MOffsOperand *result; /* Structure à retourner */
- GImmOperand *offset; /* Emplacement lu */
-
- result = NULL;
-
- assert(0);
- //offset = g_imm_operand_new_from_data_old(size, data, pos, len, SRE_LITTLE /* FIXME */);
-
- if (offset != NULL)
- {
- result = g_object_new(G_TYPE_X86_MOFFS_OPERAND, NULL);
- result->offset = offset;
- }
-
- return G_ARCH_OPERAND(result);
-
-}
-
-
-#if 0
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à transcrire. *
-* options = options de rendu. *
-* rendering = support effectif final des lignes de code. *
-* stream = flux ouvert en écriture. *
-* *
-* Description : Ajoute du texte simple à un fichier ouvert en écriture. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_moffs_operand_add_text(const GX86MOffsOperand *operand, GRenderingOptions *options, MainRendering rendering, FILE *stream)
-{
- g_content_exporter_insert_text(G_CONTENT_EXPORTER(operand), stream, "ds:", 3, RTT_SEGMENT);
-
- g_content_exporter_add_text(G_CONTENT_EXPORTER(operand->offset), options, rendering, stream);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à transcrire. *
-* buffer = espace où placer ledit contenu. *
-* options = options de rendu. *
-* *
-* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_moffs_operand_to_buffer(const GX86MOffsOperand *operand, GBufferLine *buffer, GRenderingOptions *options)
-{
- g_content_exporter_insert_into_buffer(G_CONTENT_EXPORTER(operand), buffer, BLC_ASSEMBLY,
- "ds:", 3, RTT_SEGMENT);
-
- g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->offset), buffer, options);
-
-}
-#endif
diff --git a/src/arch/x86/operands/moffs.h b/src/arch/x86/operands/moffs.h
deleted file mode 100644
index 39cac34..0000000
--- a/src/arch/x86/operands/moffs.h
+++ /dev/null
@@ -1,59 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * moffs.h - prototypes pour les opérandes d'emplacements mémoire
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_OPERANDS_MOFFS_H
-#define _ARCH_X86_OPERANDS_MOFFS_H
-
-
-#include <glib-object.h>
-
-
-#include "../../operand.h"
-#include "../../../common/endianness.h"
-
-
-
-#define G_TYPE_X86_MOFFS_OPERAND g_x86_moffs_operand_get_type()
-#define G_X86_MOFFS_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_x86_moffs_operand_get_type(), GX86MoffsOperand))
-#define G_IS_X86_MOFFS_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_x86_moffs_operand_get_type()))
-#define G_X86_MOFFS_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_X86_MOFFS_OPERAND, GX86MoffsOperandClass))
-#define G_IS_X86_MOFFS_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_X86_MOFFS_OPERAND))
-#define G_X86_MOFFS_OPERAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_X86_MOFFS_OPERAND, GX86MoffsOperandClass))
-
-
-/* Définition d'un opérande visant un emplacement mémoire x86 (instance) */
-typedef struct _GX86MOffsOperand GX86MOffsOperand;
-
-/* Définition d'un opérande visant un emplacement mémoire x86 (classe) */
-typedef struct _GX86MOffsOperandClass GX86MOffsOperandClass;
-
-
-/* Indique le type défini par la GLib pour un opérande d'emplacement mémoire x86. */
-GType g_x86_moffs_operand_get_type(void);
-
-/* Crée un opérande d'emplacement mémoire x86. */
-GArchOperand *g_x86_moffs_operand_new(const bin_t *, off_t *, off_t, MemoryDataSize);
-
-
-
-#endif /* _ARCH_X86_OPERANDS_MOFFS_H */
diff --git a/src/arch/x86/operands/register.c b/src/arch/x86/operands/register.c
deleted file mode 100644
index 800bad6..0000000
--- a/src/arch/x86/operands/register.c
+++ /dev/null
@@ -1,263 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * register.c - opérandes visant un registre x86
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "../../operand-int.h"
-
-
-
-/* Définition d'un opérande visant un registre x86 (instance) */
-struct _GX86RegisterOperand
-{
- GArchOperand parent; /* Instance parente */
-
- GX86Register *reg; /* Registre représenté */
-
-};
-
-
-/* Définition d'un opérande visant un registre x86 (classe) */
-struct _GX86RegisterOperandClass
-{
- GArchOperandClass parent; /* Classe parente */
-
-};
-
-
-/* Initialise la classe des opérandes de registre x86. */
-static void g_x86_register_operand_class_init(GX86RegisterOperandClass *);
-
-/* Initialise une instance d'opérande de registre x86. */
-static void g_x86_register_operand_init(GX86RegisterOperand *);
-
-/* Compare un opérande avec un autre. */
-static bool g_x86_register_operand_compare(const GX86RegisterOperand *, const GX86RegisterOperand *);
-
-/* Traduit un opérande en version humainement lisible. */
-static void g_x86_register_operand_print(const GX86RegisterOperand *, GBufferLine *, AsmSyntax);
-
-
-
-/* Indique le type défini par la GLib pour un opérande de registre x86. */
-G_DEFINE_TYPE(GX86RegisterOperand, g_x86_register_operand, G_TYPE_ARCH_OPERAND);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des opérandes de registre x86. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_register_operand_class_init(GX86RegisterOperandClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = instance à initialiser. *
-* *
-* Description : Initialise une instance d'opérande de registre x86. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_register_operand_init(GX86RegisterOperand *operand)
-{
- GArchOperand *parent; /* Instance parente */
-
- parent = G_ARCH_OPERAND(operand);
-
- parent->compare = (operand_compare_fc)g_x86_register_operand_compare;
- parent->print = (operand_print_fc)g_x86_register_operand_print;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* size = taille de l'opérande, et donc du registre. *
-* base = indice du premier registre. *
-* *
-* Description : Crée un opérande visant un registre x86. *
-* *
-* Retour : Opérande mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchOperand *g_x86_register_operand_new_from_opcode(const bin_t *data, off_t *pos, off_t len, MemoryDataSize size, bin_t base)
-{
- GX86RegisterOperand *result; /* Structure à retourner */
- GX86Register *reg; /* Registre lu */
-
- reg = g_x86_register_new(size, data[*pos] - base);
-
- if (reg != NULL)
- {
- (*pos)++;
-
- result = g_object_new(G_TYPE_X86_REGISTER_OPERAND, NULL);
-
- result->reg = reg;
-
- }
- else result = NULL;
-
- return G_ARCH_OPERAND(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* size = taille de l'opérande, et donc du registre. *
-* first = indique la partie du ModR/M à traiter. *
-* *
-* Description : Crée un opérande visant un registre x86. *
-* *
-* Retour : Opérande mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchOperand *g_x86_register_operand_new_from_mod_rm(const bin_t *data, off_t *pos, off_t len, MemoryDataSize size, bool first)
-{
- GX86RegisterOperand *result; /* Structure à retourner */
- bin_t index; /* Registre lu */
- GX86Register *reg; /* Registre créé */
-
- if (first) index = data[*pos] & 0x07;
- else index = (data[*pos] & 0x38) >> 3;
-
- reg = g_x86_register_new(size, index);
-
- if (reg != NULL)
- {
- (*pos)++;
-
- result = g_object_new(G_TYPE_X86_REGISTER_OPERAND, NULL);
-
- result->reg = reg;
-
- }
- else result = NULL;
-
- return G_ARCH_OPERAND(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : index = indice du registre visé. *
-* size = taille de l'opérande, et donc du registre. *
-* *
-* Description : Crée un opérande visant un registre x86 donné. *
-* *
-* Retour : Opérande mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchOperand *g_x86_register_operand_new_from_index(bin_t index, MemoryDataSize size)
-{
- GX86RegisterOperand *result; /* Structure à retourner */
- GX86Register *reg; /* Registre lu */
-
- reg = g_x86_register_new(size, index);
-
- if (reg != NULL)
- {
- result = g_object_new(G_TYPE_X86_REGISTER_OPERAND, NULL);
-
- result->reg = reg;
-
- }
- else result = NULL;
-
- return G_ARCH_OPERAND(result);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : a = premier opérande à consulter. *
-* b = second opérande à consulter. *
-* *
-* Description : Compare un opérande avec un autre. *
-* *
-* Retour : Bilan de la comparaison. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_x86_register_operand_compare(const GX86RegisterOperand *a, const GX86RegisterOperand *b)
-{
- return g_x86_register_compare(a->reg, b->reg);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à traiter. *
-* line = ligne tampon où imprimer l'opérande donné. *
-* syntax = type de représentation demandée. *
-* *
-* Description : Traduit un opérande en version humainement lisible. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_register_operand_print(const GX86RegisterOperand *operand, GBufferLine *line, AsmSyntax syntax)
-{
- g_x86_pool_operand_print(operand->reg, line, syntax);
-
-}
diff --git a/src/arch/x86/operands/register.h b/src/arch/x86/operands/register.h
deleted file mode 100644
index 8bee621..0000000
--- a/src/arch/x86/operands/register.h
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * register.h - prototypes pour les opérandes visant un registre x86
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_OPERANDS_REGISTER_H
-#define _ARCH_X86_OPERANDS_REGISTER_H
-
-
-#include <glib-object.h>
-
-
-#include "../register.h"
-#include "../../operand.h"
-#include "../../../common/endianness.h"
-
-
-
-#define G_TYPE_X86_REGISTER_OPERAND g_x86_register_operand_get_type()
-#define G_X86_REGISTER_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_x86_register_operand_get_type(), GX86RegisterOperand))
-#define G_IS_X86_REGISTER_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_x86_register_operand_get_type()))
-#define G_X86_REGISTER_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_X86_REGISTER_OPERAND, GX86RegisterOperandClass))
-#define G_IS_X86_REGISTER_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_X86_REGISTER_OPERAND))
-#define G_X86_REGISTER_OPERAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_X86_REGISTER_OPERAND, GX86RegisterOperandClass))
-
-
-/* Définition d'un opérande visant un registre x86 (instance) */
-typedef struct _GX86RegisterOperand GX86RegisterOperand;
-
-/* Définition d'un opérande visant un registre x86 (classe) */
-typedef struct _GX86RegisterOperandClass GX86RegisterOperandClass;
-
-
-/* Indique le type défini par la GLib pour un opérande de registre x86. */
-GType g_x86_register_operand_get_type(void);
-
-/* Crée un opérande visant un registre x86. */
-GArchOperand *g_x86_register_operand_new_from_opcode(const bin_t *, off_t *, off_t, MemoryDataSize, bin_t);
-
-/* Crée un opérande visant un registre x86. */
-GArchOperand *g_x86_register_operand_new_from_mod_rm(const bin_t *, off_t *, off_t, MemoryDataSize, bool);
-
-/* Crée un opérande visant un registre x86 donné. */
-GArchOperand *g_x86_register_operand_new_from_index(bin_t, MemoryDataSize);
-
-
-
-#endif /* _ARCH_X86_OPERANDS_REGISTER_H */
diff --git a/src/arch/x86/operands/relative.c b/src/arch/x86/operands/relative.c
deleted file mode 100644
index 6c5b913..0000000
--- a/src/arch/x86/operands/relative.c
+++ /dev/null
@@ -1,211 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * relative.c - opérandes d'adresses relatives
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "relative.h"
-
-
-#include "../../operand-int.h"
-
-
-
-/* Définition d'un opérande x86 d'adresse relative (instance) */
-struct _GX86RelativeOperand
-{
- GArchOperand parent; /* Instance parente */
-
- GImmOperand *immediate; /* Adresse visée reconstituée */
-
-};
-
-/* Définition d'un opérande x86 d'adresse relative (classe) */
-struct _GX86RelativeOperandClass
-{
- GArchOperandClass parent; /* Classe parente */
-
-};
-
-
-/* Initialise la classe des opérandes x86 d'adresse relative. */
-static void g_x86_relative_operand_class_init(GX86RelativeOperandClass *);
-
-/* Initialise une instance d'opérande x86 d'adresse relative. */
-static void g_x86_relative_operand_init(GX86RelativeOperand *);
-
-
-
-/* Indique le type défini par la GLib pour un opérande x86 d'adresse relative. */
-G_DEFINE_TYPE(GX86RelativeOperand, g_x86_relative_operand, G_TYPE_ARCH_OPERAND);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des opérandes x86 d'adresse relative. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_relative_operand_class_init(GX86RelativeOperandClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = instance à initialiser. *
-* *
-* Description : Initialise une instance d'opérande x86 d'adresse relative. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_relative_operand_init(GX86RelativeOperand *operand)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* size = taille de l'opérande, et donc du registre. *
-* base = adresse de référence pour le calcul. *
-* *
-* Description : Crée un opérande X86 d'adresse relative. *
-* *
-* Retour : Opérande mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchOperand *g_x86_relative_operand_new(const bin_t *data, off_t *pos, off_t len, MemoryDataSize size, vmpa_t base)
-{
- GX86RelativeOperand *result; /* Structure à retourner */
- off_t init_pos; /* Position avant lecture */
- int8_t val8; /* Valeur sur 8 bits */
- int16_t val16; /* Valeur sur 16 bits */
- int32_t val32; /* Valeur sur 32 bits */
- vmpa_t address; /* Adresse finale visée */
-
- init_pos = *pos;
-
- switch (size)
- {
- case MDS_8_BITS_UNSIGNED:
- read_s8(&val8, data, pos, len, SRE_LITTLE /* FIXME */);
- address = base + (*pos - init_pos) + val8;
- break;
- case MDS_16_BITS_UNSIGNED:
- read_s16(&val16, data, pos, len, SRE_LITTLE /* FIXME */);
- address = base + (*pos - init_pos) + val16;
- break;
- case MDS_32_BITS_UNSIGNED:
- read_s32(&val32, data, pos, len, SRE_LITTLE /* FIXME */);
- address = base + (*pos - init_pos) + val32;
- break;
- default:
- return NULL;
- break;
- }
-
- result = g_object_new(G_TYPE_X86_RELATIVE_OPERAND, NULL);
- result->immediate = g_imm_operand_new_from_value(MDS_32_BITS/*FIXME*/, (uint32_t)address/* FIXME */);
-
- return G_ARCH_OPERAND(result);
-
-}
-
-
-#if 0
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à transcrire. *
-* options = options de rendu. *
-* rendering = support effectif final des lignes de code. *
-* stream = flux ouvert en écriture. *
-* *
-* Description : Ajoute du texte simple à un fichier ouvert en écriture. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_relative_operand_add_text(const GX86RelativeOperand *operand, GRenderingOptions *options, MainRendering rendering, FILE *stream)
-{
- g_content_exporter_add_text(G_CONTENT_EXPORTER(operand->immediate), options, rendering, stream);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à transcrire. *
-* buffer = espace où placer ledit contenu. *
-* options = options de rendu. *
-* *
-* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_relative_operand_to_buffer(const GX86RelativeOperand *operand, GBufferLine *buffer, GRenderingOptions *options)
-{
- g_content_exporter_to_buffer(G_CONTENT_EXPORTER(operand->immediate), buffer, options);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = opérande à traiter. *
-* *
-* Description : Fournit l'adresse représentée par une opérande X86. *
-* *
-* Retour : Valeur portée par l'opérande. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-const GImmOperand *g_x86_relative_operand_get_value(const GX86RelativeOperand *operand)
-{
- return operand->immediate;
-
-}
diff --git a/src/arch/x86/operands/relative.h b/src/arch/x86/operands/relative.h
deleted file mode 100644
index cbd4c9b..0000000
--- a/src/arch/x86/operands/relative.h
+++ /dev/null
@@ -1,63 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * relative.h - prototypes pour les opérandes d'adresses relatives
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_OPERANDS_RELATIVE_H
-#define _ARCH_X86_OPERANDS_RELATIVE_H
-
-
-#include <glib-object.h>
-
-
-#include "../../immediate.h"
-#include "../../operand.h"
-#include "../../../common/endianness.h"
-
-
-
-#define G_TYPE_X86_RELATIVE_OPERAND g_x86_relative_operand_get_type()
-#define G_X86_RELATIVE_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_x86_relative_operand_get_type(), GX86RelativeOperand))
-#define G_IS_X86_RELATIVE_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_x86_relative_operand_get_type()))
-#define G_X86_RELATIVE_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_X86_RELATIVE_OPERAND, GX86RelativeOperandClass))
-#define G_IS_X86_RELATIVE_OPERAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_X86_RELATIVE_OPERAND))
-#define G_X86_RELATIVE_OPERAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_X86_RELATIVE_OPERAND, GX86RelativeOperandClass))
-
-
-/* Définition d'un opérande x86 d'adresse relative (instance) */
-typedef struct _GX86RelativeOperand GX86RelativeOperand;
-
-/* Définition d'un opérande x86 d'adresse relative (classe) */
-typedef struct _GX86RelativeOperandClass GX86RelativeOperandClass;
-
-
-/* Indique le type défini par la GLib pour un opérande x86 d'adresse relative. */
-GType g_x86_relative_operand_get_type(void);
-
-/* Crée un opérande X86 d'adresse relative. */
-GArchOperand *g_x86_relative_operand_new(const bin_t *, off_t *, off_t, MemoryDataSize, vmpa_t);
-
-/* Fournit l'adresse représentée par une opérande X86. */
-const GImmOperand *g_x86_relative_operand_get_value(const GX86RelativeOperand *);
-
-
-
-#endif /* _ARCH_X86_OPERANDS_RELATIVE_H */
diff --git a/src/arch/x86/processor.c b/src/arch/x86/processor.c
deleted file mode 100644
index a7a86ac..0000000
--- a/src/arch/x86/processor.c
+++ /dev/null
@@ -1,531 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * processor.c - gestion de l'architecture x86
- *
- * Copyright (C) 2008-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "opcodes/opcodes.h"
-#include "../processor-int.h"
-
-
-
-/* Définition du processeur de la x86 (instance) */
-struct _GX86Processor
-{
- GArchProcessor parent; /* Instance parente */
-
-};
-
-
-/* Définition du processeur de la x86 (classe) */
-struct _GX86ProcessorClass
-{
- GArchProcessorClass parent; /* Classe parente */
-
-};
-
-
-/* Initialise la classe des processeurs x86. */
-static void g_x86_processor_class_init(GX86ProcessorClass *);
-
-/* Initialise une instance de processeur x86. */
-static void g_x86_processor_init(GX86Processor *);
-
-/* Supprime toutes les références externes. */
-static void g_x86_processor_dispose(GX86Processor *);
-
-/* Procède à la libération totale de la mémoire. */
-static void g_x86_processor_finalize(GX86Processor *);
-
-/* Décode une instruction dans un flux de données. */
-static GArchInstruction *g_x86_processor_decode_instruction(const GX86Processor *, const bin_t *, off_t *, off_t, vmpa_t);
-
-
-/* Indique le type défini par la GLib pour le processeur x86. */
-G_DEFINE_TYPE(GX86Processor, g_x86_processor, G_TYPE_ARCH_PROCESSOR);
-
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des processeurs x86. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_processor_class_init(GX86ProcessorClass *klass)
-{
- GObjectClass *object; /* Autre version de la classe */
- GArchProcessorClass *proc; /* Encore une autre vision... */
-
- object = G_OBJECT_CLASS(klass);
-
- object->dispose = (GObjectFinalizeFunc/* ! */)g_x86_processor_dispose;
- object->finalize = (GObjectFinalizeFunc)g_x86_processor_finalize;
-
- proc = G_ARCH_PROCESSOR_CLASS(klass);
-
- proc->decode = (decode_instruction_fc)g_x86_processor_decode_instruction;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : proc = instance à initialiser. *
-* *
-* Description : Initialise une instance de processeur x86. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_processor_init(GX86Processor *proc)
-{
- GArchProcessor *parent; /* Instance parente */
-
- parent = G_ARCH_PROCESSOR(proc);
-
- parent->endianness = SRE_BIG;
- parent->memsize = MDS_32_BITS;
- parent->inssize = MDS_8_BITS;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : proc = instance d'objet GLib à traiter. *
-* *
-* Description : Supprime toutes les références externes. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_processor_dispose(GX86Processor *proc)
-{
- G_OBJECT_CLASS(g_x86_processor_parent_class)->dispose(G_OBJECT(proc));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : bookmark = instance d'objet GLib à traiter. *
-* *
-* Description : Procède à la libération totale de la mémoire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_processor_finalize(GX86Processor *proc)
-{
- G_OBJECT_CLASS(g_x86_processor_parent_class)->finalize(G_OBJECT(proc));
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Crée le support de l'architecture x86. *
-* *
-* Retour : Architecture mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchProcessor *g_x86_processor_new(void)
-{
- GArchProcessor *result; /* Structure à retourner */
-
- result = g_object_new(G_TYPE_X86_PROCESSOR, NULL);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : proc = architecture visée par la consultation. *
-* prefix = bascule à consulter. *
-* *
-* Description : Fournit la taille supplantée des opérandes pour x86. *
-* *
-* Retour : Taille d'opérande (16 ou 32 bits). *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-MemoryDataSize g_x86_processor_get_operand_size(const GX86Processor *proc, X86Prefix prefix)
-{
- MemoryDataSize result; /* Taille à renvoyer */
-
- /* FIXME */
-
- if (prefix & XPX_OPERAND_SIZE_OVERRIDE)
- result = (MDS_32_BITS/*proc->operand_size*/ == MDS_32_BITS ? MDS_16_BITS : MDS_32_BITS);
-
- else result = MDS_32_BITS/*proc->operand_size*/;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : proc = architecture visée par la procédure. *
-* data = flux de données à analyser. *
-* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
-* addr = adresse virtuelle de l'instruction. *
-* *
-* Description : Décode une instruction dans un flux de données. *
-* *
-* Retour : Instruction mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GArchInstruction *g_x86_processor_decode_instruction(const GX86Processor *proc, const bin_t *data, off_t *pos, off_t len, vmpa_t addr)
-{
- GArchInstruction *result; /* Instruction à renvoyer */
- X86Prefix prefix; /* Préfixes avec l'instr. */
- bool care; /* Traitement des opcodes */
- X86Opcodes id; /* Identifiant d'instruction */
-
- static const x86_read_instr decodings[XOP_COUNT] = {
-
- /* Instructions avec opcode sur un octet */
-
- [XOP_ADD_RM8_R8] = x86_read_instr_add_rm8_r8,
- [XOP_ADD_RM1632_R1632] = x86_read_instr_add_rm1632_r1632,
- [XOP_ADD_R8_RM8] = x86_read_instr_add_r8_rm8,
- [XOP_ADD_R1632_RM1632] = x86_read_instr_add_r1632_rm1632,
- [XOP_ADD_AL_IMM8] = x86_read_instr_add_al_imm8,
- [XOP_ADD_E_AX_IMM1632] = x86_read_instr_add_e_ax_imm1632,
- [XOP_OR_RM8_R8] = x86_read_instr_or_rm8_r8,
- [XOP_OR_RM1632_R1632] = x86_read_instr_or_rm1632_r1632,
- [XOP_OR_R8_RM8] = x86_read_instr_or_r8_rm8,
- [XOP_OR_R1632_RM1632] = x86_read_instr_or_r1632_rm1632,
- [XOP_OR_AL_IMM8] = x86_read_instr_or_al_imm8,
- [XOP_ADC_RM8_R8] = x86_read_instr_adc_rm8_r8,
- [XOP_SBB_RM1632_R1632] = x86_read_instr_sbb_rm1632_r1632,
- [XOP_AND_RM8_R8] = x86_read_instr_and_rm8_r8,
- [XOP_AND_RM1632_R1632] = x86_read_instr_and_rm1632_r1632,
- [XOP_AND_AL_IMM8] = x86_read_instr_and_al_imm8,
- [XOP_AND_E_AX_IMM1632] = x86_read_instr_and_e_ax_imm1632,
- [XOP_SUB_RM1632_R1632] = x86_read_instr_sub_rm1632_r1632,
- [XOP_SUB_R8_RM8] = x86_read_instr_sub_r8_rm8,
- [XOP_SUB_R1632_RM1632] = x86_read_instr_sub_r1632_rm1632,
- [XOP_SUB_AL_IMM8] = x86_read_instr_sub_al_imm8,
- [XOP_SUB_E_AX_IMM1632] = x86_read_instr_sub_e_ax_imm1632,
- [XOP_XOR_RM8_R8] = x86_read_instr_xor_rm8_r8,
- [XOP_XOR_RM1632_R1632] = x86_read_instr_xor_rm1632_r1632,
- [XOP_XOR_R8_RM8] = x86_read_instr_xor_r8_rm8,
- [XOP_XOR_R1632_RM1632] = x86_read_instr_xor_r1632_rm1632,
- [XOP_XOR_AL_IMM8] = x86_read_instr_xor_al_imm8,
- [XOP_XOR_E_AX_IMM1632] = x86_read_instr_xor_e_ax_imm1632,
- [XOP_CMP_RM8_R8] = x86_read_instr_cmp_rm8_r8,
- [XOP_CMP_RM1632_R1632] = x86_read_instr_cmp_rm1632_r1632,
- [XOP_CMP_R8_RM8] = x86_read_instr_cmp_r8_rm8,
- [XOP_CMP_R1632_RM1632] = x86_read_instr_cmp_r1632_rm1632,
- [XOP_CMP_AL_IMM8] = x86_read_instr_cmp_al_imm8,
- [XOP_CMP_E_AX_IMM1632] = x86_read_instr_cmp_e_ax_imm1632,
- [XOP_INC_E_AX] = x86_read_instr_inc_r1632,
- [XOP_INC_E_CX] = x86_read_instr_inc_r1632,
- [XOP_INC_E_DX] = x86_read_instr_inc_r1632,
- [XOP_INC_E_BX] = x86_read_instr_inc_r1632,
- [XOP_INC_E_SP] = x86_read_instr_inc_r1632,
- [XOP_INC_E_BP] = x86_read_instr_inc_r1632,
- [XOP_INC_E_SI] = x86_read_instr_inc_r1632,
- [XOP_INC_E_DI] = x86_read_instr_inc_r1632,
- [XOP_DEC_E_AX] = x86_read_instr_dec_r1632,
- [XOP_DEC_E_CX] = x86_read_instr_dec_r1632,
- [XOP_DEC_E_DX] = x86_read_instr_dec_r1632,
- [XOP_DEC_E_BX] = x86_read_instr_dec_r1632,
- [XOP_DEC_E_SP] = x86_read_instr_dec_r1632,
- [XOP_DEC_E_BP] = x86_read_instr_dec_r1632,
- [XOP_DEC_E_SI] = x86_read_instr_dec_r1632,
- [XOP_DEC_E_DI] = x86_read_instr_dec_r1632,
- [XOP_PUSH_E_AX] = x86_read_instr_push_r1632,
- [XOP_PUSH_E_CX] = x86_read_instr_push_r1632,
- [XOP_PUSH_E_DX] = x86_read_instr_push_r1632,
- [XOP_PUSH_E_BX] = x86_read_instr_push_r1632,
- [XOP_PUSH_E_SP] = x86_read_instr_push_r1632,
- [XOP_PUSH_E_BP] = x86_read_instr_push_r1632,
- [XOP_PUSH_E_SI] = x86_read_instr_push_r1632,
- [XOP_PUSH_E_DI] = x86_read_instr_push_r1632,
- [XOP_POP_E_AX] = x86_read_instr_pop_r1632,
- [XOP_POP_E_CX] = x86_read_instr_pop_r1632,
- [XOP_POP_E_DX] = x86_read_instr_pop_r1632,
- [XOP_POP_E_BX] = x86_read_instr_pop_r1632,
- [XOP_POP_E_SP] = x86_read_instr_pop_r1632,
- [XOP_POP_E_BP] = x86_read_instr_pop_r1632,
- [XOP_POP_E_SI] = x86_read_instr_pop_r1632,
- [XOP_POP_E_DI] = x86_read_instr_pop_r1632,
- [XOP_POPA] = x86_read_instr_popa,
- [XOP_ARPL_RM16_R16] = x86_read_instr_arpl_rm16_r16,
- [XOP_PUSH_IMM1632] = x86_read_instr_push_imm1632,
- [XOP_IMUL_R1632_RM1632_IMM1632] = x86_read_instr_imul_r1632_rm1632_imm1632,
- [XOP_IMUL_RM1632_IMM8] = x86_read_instr_imul_rm1632_imm8,
- [XOP_JO_REL8] = x86_read_instr_jo_rel8,
- [XOP_JNO_REL8] = x86_read_instr_jno_rel8,
- [XOP_JB_REL8] = x86_read_instr_jb_rel8,
- [XOP_JNB_REL8] = x86_read_instr_jnb_rel8,
- [XOP_JE_REL8] = x86_read_instr_je_rel8,
- [XOP_JNE_REL8] = x86_read_instr_jne_rel8,
- [XOP_JNA_REL8] = x86_read_instr_jna_rel8,
- [XOP_JA_REL8] = x86_read_instr_ja_rel8,
- [XOP_JS_REL8] = x86_read_instr_js_rel8,
- [XOP_JNS_REL8] = x86_read_instr_jns_rel8,
- [XOP_JP_REL8] = x86_read_instr_jp_rel8,
- [XOP_JNP_REL8] = x86_read_instr_jnp_rel8,
- [XOP_JL_REL8] = x86_read_instr_jl_rel8,
- [XOP_JNL_REL8] = x86_read_instr_jnl_rel8,
- [XOP_JNG_REL8] = x86_read_instr_jng_rel8,
- [XOP_JG_REL8] = x86_read_instr_jg_rel8,
- [XOP_ADD_RM8_IMM8] = x86_read_instr_add_rm8_imm8,
- [XOP_OR_RM8_IMM8] = x86_read_instr_or_rm8_imm8,
- [XOP_ADC_RM8_IMM8] = x86_read_instr_adc_rm8_imm8,
- [XOP_SBB_RM8_IMM8] = x86_read_instr_sbb_rm8_imm8,
- [XOP_AND_RM8_IMM8] = x86_read_instr_and_rm8_imm8,
- [XOP_SUB_RM8_IMM8] = x86_read_instr_sub_rm8_imm8,
- [XOP_XOR_RM8_IMM8] = x86_read_instr_xor_rm8_imm8,
- [XOP_CMP_RM8_IMM8] = x86_read_instr_cmp_rm8_imm8,
- [XOP_ADD_RM1632_IMM1632] = x86_read_instr_add_rm1632_imm1632,
- [XOP_OR_RM1632_IMM1632] = x86_read_instr_or_rm1632_imm1632,
- [XOP_ADC_RM1632_IMM1632] = x86_read_instr_adc_rm1632_imm1632,
- [XOP_SBB_RM1632_IMM1632] = x86_read_instr_sbb_rm1632_imm1632,
- [XOP_AND_RM1632_IMM1632] = x86_read_instr_and_rm1632_imm1632,
- [XOP_SUB_RM1632_IMM1632] = x86_read_instr_sub_rm1632_imm1632,
- [XOP_XOR_RM1632_IMM1632] = x86_read_instr_xor_rm1632_imm1632,
- [XOP_CMP_RM1632_IMM1632] = x86_read_instr_cmp_rm1632_imm1632,
- [XOP_ADD_RM1632_IMM8] = x86_read_instr_add_rm1632_imm8,
- [XOP_OR_RM1632_IMM8] = x86_read_instr_or_rm1632_imm8,
- [XOP_ADC_RM1632_IMM8] = x86_read_instr_adc_rm1632_imm8,
- [XOP_SBB_RM1632_IMM8] = x86_read_instr_sbb_rm1632_imm8,
- [XOP_AND_RM1632_IMM8] = x86_read_instr_and_rm1632_imm8,
- [XOP_SUB_RM1632_IMM8] = x86_read_instr_sub_rm1632_imm8,
- [XOP_XOR_RM1632_IMM8] = x86_read_instr_xor_rm1632_imm8,
- [XOP_CMP_RM1632_IMM8] = x86_read_instr_cmp_rm1632_imm8,
- [XOP_TEST_RM8_R8] = x86_read_instr_test_rm8_r8,
- [XOP_TEST_RM1632_R1632] = x86_read_instr_test_rm1632_r1632,
- [XOP_MOV_RM8_R8] = x86_read_instr_mov_rm8_r8,
- [XOP_MOV_RM1632_R1632] = x86_read_instr_mov_rm1632_r1632,
- [XOP_MOV_R1632_RM1632] = x86_read_instr_mov_r1632_rm1632,
- [XOP_LEA_R1632_M] = x86_read_instr_lea_r1632_m,
- [XOP_NOP] = x86_read_instr_nop,
- [XOP_XCHG_R1632_E_AX] = x86_read_instr_xchg_r1632_e_ax,
- [XOP_XCHG_R1632_E_CX] = x86_read_instr_xchg_r1632_e_ax,
- [XOP_XCHG_R1632_E_DX] = x86_read_instr_xchg_r1632_e_ax,
- [XOP_XCHG_R1632_E_BX] = x86_read_instr_xchg_r1632_e_ax,
- [XOP_XCHG_R1632_E_SP] = x86_read_instr_xchg_r1632_e_ax,
- [XOP_XCHG_R1632_E_BP] = x86_read_instr_xchg_r1632_e_ax,
- [XOP_XCHG_R1632_E_SI] = x86_read_instr_xchg_r1632_e_ax,
- [XOP_XCHG_R1632_E_DI] = x86_read_instr_xchg_r1632_e_ax,
- [XOP_MOV_AL_MOFFS8] = x86_read_instr_mov_al_moffs8,
- [XOP_MOV_E_AX_MOFFS1632] = x86_read_instr_mov_e_ax_moffs1632,
- [XOP_MOV_MOFFS8_AL] = x86_read_instr_mov_moffs8_al,
- [XOP_MOV_MOFFS1632_E_AX] = x86_read_instr_mov_moffs1632_e_ax,
- [XOP_MOVS_M1632_M1632] = x86_read_instr_movs_m1632_m1632,
- [XOP_CMPS_M8_M8] = x86_read_instr_cmps_m8_m8,
- [XOP_TEST_AL_IMM8] = x86_read_instr_test_al_imm8,
- [XOP_TEST_E_AX_IMM1632] = x86_read_instr_test_e_ax_imm1632,
- [XOP_STOS_M1632_E_AX] = x86_read_instr_stos_m1632_e_ax,
- [XOP_SCAS_AL_M8] = x86_read_instr_scas_al_m8,
- [XOP_MOV_AL_IMM8] = x86_read_instr_mov_r8_imm8,
- [XOP_MOV_CL_IMM8] = x86_read_instr_mov_r8_imm8,
- [XOP_MOV_DL_IMM8] = x86_read_instr_mov_r8_imm8,
- [XOP_MOV_BL_IMM8] = x86_read_instr_mov_r8_imm8,
- [XOP_MOV_AH_IMM8] = x86_read_instr_mov_r8_imm8,
- [XOP_MOV_CH_IMM8] = x86_read_instr_mov_r8_imm8,
- [XOP_MOV_DH_IMM8] = x86_read_instr_mov_r8_imm8,
- [XOP_MOV_BH_IMM8] = x86_read_instr_mov_r8_imm8,
- [XOP_MOV_E_AX_IMM1632] = x86_read_instr_mov_r1632_imm1632,
- [XOP_MOV_E_CX_IMM1632] = x86_read_instr_mov_r1632_imm1632,
- [XOP_MOV_E_DX_IMM1632] = x86_read_instr_mov_r1632_imm1632,
- [XOP_MOV_E_BX_IMM1632] = x86_read_instr_mov_r1632_imm1632,
- [XOP_MOV_E_SP_IMM1632] = x86_read_instr_mov_r1632_imm1632,
- [XOP_MOV_E_BP_IMM1632] = x86_read_instr_mov_r1632_imm1632,
- [XOP_MOV_E_SI_IMM1632] = x86_read_instr_mov_r1632_imm1632,
- [XOP_MOV_E_DI_IMM1632] = x86_read_instr_mov_r1632_imm1632,
- [XOP_ROL_RM8_IMM8] = x86_read_instr_rol_rm8_imm8,
- [XOP_ROR_RM8_IMM8] = x86_read_instr_ror_rm8_imm8,
- [XOP_RCL_RM8_IMM8] = x86_read_instr_rcl_rm8_imm8,
- [XOP_RCR_RM8_IMM8] = x86_read_instr_rcr_rm8_imm8,
- [XOP_SHL_RM8_IMM8] = x86_read_instr_shl_rm8_imm8,
- [XOP_SHR_RM8_IMM8] = x86_read_instr_shr_rm8_imm8,
- [XOP_SAL_RM8_IMM8] = x86_read_instr_sal_rm8_imm8,
- [XOP_SAR_RM8_IMM8] = x86_read_instr_sar_rm8_imm8,
- [XOP_ROL_RM1632_IMM8] = x86_read_instr_rol_rm1632_imm8,
- [XOP_ROR_RM1632_IMM8] = x86_read_instr_ror_rm1632_imm8,
- [XOP_RCL_RM1632_IMM8] = x86_read_instr_rcl_rm1632_imm8,
- [XOP_RCR_RM1632_IMM8] = x86_read_instr_rcr_rm1632_imm8,
- [XOP_SHL_RM1632_IMM8] = x86_read_instr_shl_rm1632_imm8,
- [XOP_SHR_RM1632_IMM8] = x86_read_instr_shr_rm1632_imm8,
- [XOP_SAL_RM1632_IMM8] = x86_read_instr_sal_rm1632_imm8,
- [XOP_SAR_RM1632_IMM8] = x86_read_instr_sar_rm1632_imm8,
- [XOP_RETN_IMM16] = x86_read_instr_retn_imm16,
- [XOP_RETN] = x86_read_instr_retn,
- [XOP_MOV_RM8_IMM8] = x86_read_instr_mov_rm8_imm8,
- [XOP_MOV_RM1632_IMM1632] = x86_read_instr_mov_rm1632_imm1632,
- [XOP_LEAVE] = x86_read_instr_leave,
- [XOP_RETF_IMM16] = x86_read_instr_retf_imm16,
- [XOP_RETF] = x86_read_instr_retf,
- [XOP_INT_3] = x86_read_instr_int_3,
- [XOP_INT] = x86_read_instr_int_imm8,
- [XOP_ROL_RM8_1] = x86_read_instr_rol_rm8_1,
- [XOP_ROR_RM8_1] = x86_read_instr_ror_rm8_1,
- [XOP_RCL_RM8_1] = x86_read_instr_rcl_rm8_1,
- [XOP_RCR_RM8_1] = x86_read_instr_rcr_rm8_1,
- [XOP_SHL_RM8_1] = x86_read_instr_shl_rm8_1,
- [XOP_SHR_RM8_1] = x86_read_instr_shr_rm8_1,
- [XOP_SAL_RM8_1] = x86_read_instr_sal_rm8_1,
- [XOP_SAR_RM8_1] = x86_read_instr_sar_rm8_1,
- [XOP_ROL_RM1632_1] = x86_read_instr_rol_rm1632_1,
- [XOP_ROR_RM1632_1] = x86_read_instr_ror_rm1632_1,
- [XOP_RCL_RM1632_1] = x86_read_instr_rcl_rm1632_1,
- [XOP_RCR_RM1632_1] = x86_read_instr_rcr_rm1632_1,
- [XOP_SHL_RM1632_1] = x86_read_instr_shl_rm1632_1,
- [XOP_SHR_RM1632_1] = x86_read_instr_shr_rm1632_1,
- [XOP_SAL_RM1632_1] = x86_read_instr_sal_rm1632_1,
- [XOP_SAR_RM1632_1] = x86_read_instr_sar_rm1632_1,
- [XOP_ROL_RM8_CL] = x86_read_instr_rol_rm8_cl,
- [XOP_ROR_RM8_CL] = x86_read_instr_ror_rm8_cl,
- [XOP_RCL_RM8_CL] = x86_read_instr_rcl_rm8_cl,
- [XOP_RCR_RM8_CL] = x86_read_instr_rcr_rm8_cl,
- [XOP_SHL_RM8_CL] = x86_read_instr_shl_rm8_cl,
- [XOP_SHR_RM8_CL] = x86_read_instr_shr_rm8_cl,
- [XOP_SAL_RM8_CL] = x86_read_instr_sal_rm8_cl,
- [XOP_SAR_RM8_CL] = x86_read_instr_sar_rm8_cl,
- [XOP_ROL_RM1632_CL] = x86_read_instr_rol_rm1632_cl,
- [XOP_ROR_RM1632_CL] = x86_read_instr_ror_rm1632_cl,
- [XOP_RCL_RM1632_CL] = x86_read_instr_rcl_rm1632_cl,
- [XOP_RCR_RM1632_CL] = x86_read_instr_rcr_rm1632_cl,
- [XOP_SHL_RM1632_CL] = x86_read_instr_shl_rm1632_cl,
- [XOP_SHR_RM1632_CL] = x86_read_instr_shr_rm1632_cl,
- [XOP_SAL_RM1632_CL] = x86_read_instr_sal_rm1632_cl,
- [XOP_SAR_RM1632_CL] = x86_read_instr_sar_rm1632_cl,
- [XOP_CALL_REL1632] = x86_read_instr_call_rel1632,
- [XOP_JMP_REL1632] = x86_read_instr_jmp_rel1632,
- [XOP_JMP_REL8] = x86_read_instr_jmp_rel8,
- [XOP_HLT] = x86_read_instr_hlt,
- [XOP_TEST_RM8_IMM8] = x86_read_instr_test_rm8_imm8,
- [XOP_TEST_RM8_IMM8_BIS] = x86_read_instr_test_rm8_imm8,
- [XOP_NOT_RM8] = x86_read_instr_not_rm8,
- [XOP_TEST_RM1632_IMM1632] = x86_read_instr_test_rm1632_imm1632,
- [XOP_TEST_RM1632_IMM1632_BIS] = x86_read_instr_test_rm1632_imm1632,
- [XOP_NOT_RM1632] = x86_read_instr_not_rm1632,
- [XOP_IMUL_RM1632] = x86_read_instr_imul_rm1632,
- [XOP_CLD] = x86_read_instr_cld,
- [XOP_INC_RM8] = x86_read_instr_inc_rm8,
- [XOP_DEC_RM8] = x86_read_instr_dec_rm8,
- [XOP_INC_RM1632] = x86_read_instr_inc_rm1632,
- [XOP_DEC_RM1632] = x86_read_instr_dec_rm1632,
- [XOP_CALL_RM1632] = x86_read_instr_call_rm1632,
- [XOP_JMP_RM1632] = x86_read_instr_jmp_rm1632,
- [XOP_PUSH_RM1632] = x86_read_instr_push_rm1632,
-
- /* Instructions avec opcode sur deux octets */
-
- [XOP_JO_REL1632] = x86_read_instr_jo_rel1632,
- [XOP_JNO_REL1632] = x86_read_instr_jno_rel1632,
- [XOP_JB_REL1632] = x86_read_instr_jb_rel1632,
- [XOP_JNB_REL1632] = x86_read_instr_jnb_rel1632,
- [XOP_JE_REL1632] = x86_read_instr_je_rel1632,
- [XOP_JNE_REL1632] = x86_read_instr_jne_rel1632,
- [XOP_JNA_REL1632] = x86_read_instr_jna_rel1632,
- [XOP_JA_REL1632] = x86_read_instr_ja_rel1632,
- [XOP_JS_REL1632] = x86_read_instr_js_rel1632,
- [XOP_JNS_REL1632] = x86_read_instr_jns_rel1632,
- [XOP_JP_REL1632] = x86_read_instr_jp_rel1632,
- [XOP_JNP_REL1632] = x86_read_instr_jnp_rel1632,
- [XOP_JL_REL1632] = x86_read_instr_jl_rel1632,
- [XOP_JNL_REL1632] = x86_read_instr_jnl_rel1632,
- [XOP_JNG_REL1632] = x86_read_instr_jng_rel1632,
- [XOP_JG_REL1632] = x86_read_instr_jg_rel1632,
- [XOP_SETO_RM8] = x86_read_instr_seto_rm8,
- [XOP_SETNO_RM8] = x86_read_instr_setno_rm8,
- [XOP_SETB_RM8] = x86_read_instr_setb_rm8,
- [XOP_SETNB_RM8] = x86_read_instr_setnb_rm8,
- [XOP_SETE_RM8] = x86_read_instr_sete_rm8,
- [XOP_SETNE_RM8] = x86_read_instr_setne_rm8,
- [XOP_SETNA_RM8] = x86_read_instr_setna_rm8,
- [XOP_SETA_RM8] = x86_read_instr_seta_rm8,
- [XOP_SETS_RM8] = x86_read_instr_sets_rm8,
- [XOP_SETNS_RM8] = x86_read_instr_setns_rm8,
- [XOP_SETP_RM8] = x86_read_instr_setp_rm8,
- [XOP_SETNP_RM8] = x86_read_instr_setnp_rm8,
- [XOP_SETL_RM8] = x86_read_instr_setl_rm8,
- [XOP_SETNL_RM8] = x86_read_instr_setnl_rm8,
- [XOP_SETNG_RM8] = x86_read_instr_setng_rm8,
- [XOP_SETG_RM8] = x86_read_instr_setg_rm8,
- [XOP_MOVZX_R1632_RM8] = x86_read_instr_movzx_r1632_rm8,
- [XOP_MOVZX_R1632_RM16] = x86_read_instr_movzx_r1632_rm16,
- [XOP_MOVSX_R1632_RM8] = x86_read_instr_movsx_r1632_rm8,
- [XOP_MOVSX_R1632_RM1632] = x86_read_instr_movsx_r1632_rm1632
-
- };
-
- id = x86_guess_next_instruction(data, *pos, len, &prefix, &care);
-
- if (prefix & XPX_TWO_BYTES)
- {
- (*pos)++;
- addr++;
- }
- if (prefix & XPX_OPERAND_SIZE_OVERRIDE) (*pos)++;
- if (prefix & XPX_REPEAT_STR_OPERATION_F2) (*pos)++;
- if (prefix & XPX_REPEAT_STR_OPERATION_F3) (*pos)++;
-
- if (id != XOP_COUNT && !care) (*pos)++;
-
- if (id == XOP_COUNT) result = NULL;
- else result = decodings[id](data, pos, len, addr, prefix, proc);
-
- if (result != NULL)
- g_x86_instruction_set_prefixes(G_X86_INSTRUCTION(result), prefix);
-
- return result;
-
-}
diff --git a/src/arch/x86/processor.h b/src/arch/x86/processor.h
deleted file mode 100644
index 0287ac3..0000000
--- a/src/arch/x86/processor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * processor.h - prototypes pour la gestion de l'architecture x86
- *
- * Copyright (C) 2008-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_PROCESSOR_H
-#define _ARCH_X86_PROCESSOR_H
-
-
-#include "../processor.h"
-#include "instruction.h" /* FIXME : remme */
-
-
-
-#define G_TYPE_X86_PROCESSOR g_x86_processor_get_type()
-#define G_X86_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_x86_processor_get_type(), GX86Processor))
-#define G_IS_X86_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_x86_processor_get_type()))
-#define G_X86_PROCESSOR_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), g_x86_processor_get_type(), GX86ProcessorIface))
-
-
-/* Définition du processeur de la x86 (instance) */
-typedef struct _GX86Processor GX86Processor;
-
-/* Définition du processeur de la x86 (classe) */
-typedef struct _GX86ProcessorClass GX86ProcessorClass;
-
-
-/* Indique le type défini par la GLib pour le processeur x86. */
-GType g_x86_processor_get_type(void);
-
-/* Crée le support de l'architecture x86. */
-GArchProcessor *g_x86_processor_new(void);
-
-/* Fournit la taille supplantée des opérandes pour x86. */
-MemoryDataSize g_x86_processor_get_operand_size(const GX86Processor *, X86Prefix);
-
-
-
-#endif /* _ARCH_X86_PROCESSOR_H */
diff --git a/src/arch/x86/register.c b/src/arch/x86/register.c
deleted file mode 100644
index 3f0e793..0000000
--- a/src/arch/x86/register.c
+++ /dev/null
@@ -1,627 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * register.c - aides auxiliaires relatives aux registres x86
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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 "../operand-int.h"
-
-
-
-/* Liste des registres 8 bits */
-typedef enum _X868bRegister
-{
- X86_REG8_AL = 0, /* Registre AL */
- X86_REG8_CL = 1, /* Registre AL */
- X86_REG8_DL = 2, /* Registre AL */
- X86_REG8_BL = 3, /* Registre AL */
- X86_REG8_AH = 4, /* Registre AH */
- X86_REG8_CH = 5, /* Registre AH */
- X86_REG8_DH = 6, /* Registre AH */
- X86_REG8_BH = 7, /* Registre AH */
-
- X86_REG8_NONE /* Aucun registre */
-
-} X868bRegister;
-
-/* Liste des registres 16 bits */
-typedef enum _X8616bRegister
-{
- X86_REG16_AX = 0, /* Registre AX */
- X86_REG16_CX = 1, /* Registre AX */
- X86_REG16_DX = 2, /* Registre AX */
- X86_REG16_BX = 3, /* Registre AX */
- X86_REG16_SP = 4, /* Registre SP */
- X86_REG16_BP = 5, /* Registre BP */
- X86_REG16_SI = 6, /* Registre SI */
- X86_REG16_DI = 7, /* Registre DI */
-
- X86_REG16_NONE /* Aucun registre */
-
-} X8616bRegister;
-
-/* Liste des registres 32 bits */
-typedef enum _X8632bRegister
-{
- X86_REG32_EAX = 0, /* Registre EAX */
- X86_REG32_ECX = 1, /* Registre EAX */
- X86_REG32_EDX = 2, /* Registre EAX */
- X86_REG32_EBX = 3, /* Registre EAX */
- X86_REG32_ESP = 4, /* Registre ESP */
- X86_REG32_EBP = 5, /* Registre EBP */
- X86_REG32_ESI = 6, /* Registre ESI */
- X86_REG32_EDI = 7, /* Registre EDI */
-
- X86_REG32_NONE /* Aucun registre */
-
-} X8632bRegister;
-
-
-/* Représentation d'un registre x86 (instance) */
-struct _GX86Register
-{
- GArchOperand parent; /* Instance parente */
-
- MemoryDataSize size; /* Taille de ce registre */
-
- union
- {
- X868bRegister reg8; /* Registre 8 bits */
- X8616bRegister reg16; /* Registre 16 bits */
- X8632bRegister reg32; /* Registre 32 bits */
-
- } reg;
-
-};
-
-
-/* Représentation d'un registre x86 (classe) */
-struct _GX86RegisterClass
-{
- GArchOperandClass parent; /* Classe parente */
-
-};
-
-
-#define MAX_REGNAME_LEN 5
-
-
-/* Initialise la classe des registres x86. */
-static void g_x86_register_class_init(GX86RegisterClass *);
-
-/* Initialise une instance de registre x86. */
-static void g_x86_register_init(GX86Register *);
-
-
-
-/* Indique le type défini pour une représentation d'un registre x86. */
-G_DEFINE_TYPE(GX86Register, g_x86_register, G_TYPE_ARCH_OPERAND);
-
-
-/******************************************************************************
-* *
-* Paramètres : klass = classe à initialiser. *
-* *
-* Description : Initialise la classe des registres x86. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_register_class_init(GX86RegisterClass *klass)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = instance à initialiser. *
-* *
-* Description : Initialise une instance de registre x86. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_x86_register_init(GX86Register *reg)
-{
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : size = indique la taille du registre. *
-* value = valeur correspondant au registre. *
-* *
-* Description : Crée une réprésentation de registre x86. *
-* *
-* Retour : Adresse de la structure mise en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GX86Register *g_x86_register_new(MemoryDataSize size, bin_t value)
-{
- GX86Register *result; /* Structure à retourner */
-
- result = g_object_new(G_TYPE_X86_REGISTER, NULL);
-
- result->size = size;
-
- switch (size)
- {
- case MDS_8_BITS:
- switch (value)
- {
- case 0 ... 7:
- result->reg.reg8 = (X868bRegister)value;
- break;
- default:
- goto gxrn_error;
- break;
- }
- break;
-
- case MDS_16_BITS:
- switch (value)
- {
- case 0 ... 7:
- result->reg.reg16 = (X8616bRegister)value;
- break;
- default:
- goto gxrn_error;
- break;
- }
- break;
-
- case MDS_32_BITS:
- switch (value)
- {
- case 0 ... 7:
- result->reg.reg32 = (X8632bRegister)value;
- break;
- default:
- goto gxrn_error;
- break;
- }
- break;
-
- default:
- goto gxrn_error;
- break;
-
- }
-
- return result;
-
- gxrn_error:
-
- g_object_unref(G_OBJECT(result));
-
- return NULL;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : a = premier opérande à consulter. *
-* b = second opérande à consulter. *
-* *
-* Description : Compare un registre avec un autre. *
-* *
-* Retour : Bilan de la comparaison. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool g_x86_register_compare(const GX86Register *a, const GX86Register *b)
-{
- bool result; /* Bilan à retourner */
-
- if (a->size != b->size)
- return false;
-
- switch (a->size)
- {
- case MDS_8_BITS:
- result = (a->reg.reg8 == b->reg.reg8);
- break;
-
- case MDS_16_BITS:
- result = (a->reg.reg16 == b->reg.reg16);
- break;
-
- case MDS_32_BITS:
- result = (a->reg.reg32 == b->reg.reg32);
- break;
-
- default:
- result = false;
- break;
-
- }
-
- 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 : - *
-* *
-******************************************************************************/
-
-void g_x86_pool_operand_print(const GX86Register *reg, GBufferLine *line, AsmSyntax syntax)
-{
- char key[MAX_REGNAME_LEN]; /* Mot clef principal */
- size_t klen; /* Taille de ce mot clef */
-
- switch (syntax)
- {
- case ASX_INTEL:
- switch (reg->size)
- {
- case MDS_8_BITS:
- klen = 2;
- switch (reg->reg.reg8)
- {
- case X86_REG8_AL:
- snprintf(key, MAX_REGNAME_LEN, "al");
- break;
- case X86_REG8_CL:
- snprintf(key, MAX_REGNAME_LEN, "cl");
- break;
- case X86_REG8_DL:
- snprintf(key, MAX_REGNAME_LEN, "dl");
- break;
- case X86_REG8_BL:
- snprintf(key, MAX_REGNAME_LEN, "bl");
- break;
- case X86_REG8_AH:
- snprintf(key, MAX_REGNAME_LEN, "ah");
- break;
- case X86_REG8_CH:
- snprintf(key, MAX_REGNAME_LEN, "ch");
- break;
- case X86_REG8_DH:
- snprintf(key, MAX_REGNAME_LEN, "dh");
- break;
- case X86_REG8_BH:
- snprintf(key, MAX_REGNAME_LEN, "bh");
- break;
- case X86_REG8_NONE:
- /* Ne devrait jamais arriver */
- break;
- }
- break;
-
- case MDS_16_BITS:
- klen = 2;
- switch (reg->reg.reg16)
- {
- case X86_REG16_AX:
- snprintf(key, MAX_REGNAME_LEN, "ax");
- break;
- case X86_REG16_CX:
- snprintf(key, MAX_REGNAME_LEN, "cx");
- break;
- case X86_REG16_DX:
- snprintf(key, MAX_REGNAME_LEN, "dx");
- break;
- case X86_REG16_BX:
- snprintf(key, MAX_REGNAME_LEN, "bx");
- break;
- case X86_REG16_SP:
- snprintf(key, MAX_REGNAME_LEN, "sp");
- break;
- case X86_REG16_BP:
- snprintf(key, MAX_REGNAME_LEN, "bp");
- break;
- case X86_REG16_SI:
- snprintf(key, MAX_REGNAME_LEN, "si");
- break;
- case X86_REG16_DI:
- snprintf(key, MAX_REGNAME_LEN, "di");
- break;
- case X86_REG16_NONE:
- /* Ne devrait jamais arriver */
- break;
- }
- break;
-
- case MDS_32_BITS:
- klen = 3;
- switch (reg->reg.reg32)
- {
- case X86_REG32_EAX:
- snprintf(key, MAX_REGNAME_LEN, "eax");
- break;
- case X86_REG32_ECX:
- snprintf(key, MAX_REGNAME_LEN, "ecx");
- break;
- case X86_REG32_EDX:
- snprintf(key, MAX_REGNAME_LEN, "edx");
- break;
- case X86_REG32_EBX:
- snprintf(key, MAX_REGNAME_LEN, "ebx");
- break;
- case X86_REG32_ESP:
- snprintf(key, MAX_REGNAME_LEN, "esp");
- break;
- case X86_REG32_EBP:
- snprintf(key, MAX_REGNAME_LEN, "ebp");
- break;
- case X86_REG32_ESI:
- snprintf(key, MAX_REGNAME_LEN, "esi");
- break;
- case X86_REG32_EDI:
- snprintf(key, MAX_REGNAME_LEN, "edi");
- break;
- case X86_REG32_NONE:
- printf("null reg\n");
- /* Ne devrait jamais arriver */
- break;
- }
- break;
-
- default:
- klen = 0;
- break;
-
- }
- break;
-
- case ASX_ATT:
- switch (reg->size)
- {
- case MDS_8_BITS:
- klen = 3;
- switch (reg->reg.reg8)
- {
- case X86_REG8_AL:
- snprintf(key, MAX_REGNAME_LEN, "%%al");
- break;
- case X86_REG8_CL:
- snprintf(key, MAX_REGNAME_LEN, "%%cl");
- break;
- case X86_REG8_DL:
- snprintf(key, MAX_REGNAME_LEN, "%%dl");
- break;
- case X86_REG8_BL:
- snprintf(key, MAX_REGNAME_LEN, "%%bl");
- break;
- case X86_REG8_AH:
- snprintf(key, MAX_REGNAME_LEN, "%%ah");
- break;
- case X86_REG8_CH:
- snprintf(key, MAX_REGNAME_LEN, "%%ch");
- break;
- case X86_REG8_DH:
- snprintf(key, MAX_REGNAME_LEN, "%%dh");
- break;
- case X86_REG8_BH:
- snprintf(key, MAX_REGNAME_LEN, "%%bh");
- break;
- case X86_REG8_NONE:
- /* Ne devrait jamais arriver */
- break;
- }
- break;
-
- case MDS_16_BITS:
- klen = 3;
- switch (reg->reg.reg16)
- {
- case X86_REG16_AX:
- snprintf(key, MAX_REGNAME_LEN, "%%ax");
- break;
- case X86_REG16_CX:
- snprintf(key, MAX_REGNAME_LEN, "%%cx");
- break;
- case X86_REG16_DX:
- snprintf(key, MAX_REGNAME_LEN, "%%dx");
- break;
- case X86_REG16_BX:
- snprintf(key, MAX_REGNAME_LEN, "%%bx");
- break;
- case X86_REG16_SP:
- snprintf(key, MAX_REGNAME_LEN, "%%sp");
- break;
- case X86_REG16_BP:
- snprintf(key, MAX_REGNAME_LEN, "%%bp");
- break;
- case X86_REG16_SI:
- snprintf(key, MAX_REGNAME_LEN, "%%si");
- break;
- case X86_REG16_DI:
- snprintf(key, MAX_REGNAME_LEN, "%%di");
- break;
- case X86_REG16_NONE:
- /* Ne devrait jamais arriver */
- break;
- }
- break;
-
- case MDS_32_BITS:
- klen = 4;
- switch (reg->reg.reg32)
- {
- case X86_REG32_EAX:
- snprintf(key, MAX_REGNAME_LEN, "%%eax");
- break;
- case X86_REG32_ECX:
- snprintf(key, MAX_REGNAME_LEN, "%%ecx");
- break;
- case X86_REG32_EDX:
- snprintf(key, MAX_REGNAME_LEN, "%%edx");
- break;
- case X86_REG32_EBX:
- snprintf(key, MAX_REGNAME_LEN, "%%ebx");
- break;
- case X86_REG32_ESP:
- snprintf(key, MAX_REGNAME_LEN, "%%esp");
- break;
- case X86_REG32_EBP:
- snprintf(key, MAX_REGNAME_LEN, "%%ebp");
- break;
- case X86_REG32_ESI:
- snprintf(key, MAX_REGNAME_LEN, "%%esi");
- break;
- case X86_REG32_EDI:
- snprintf(key, MAX_REGNAME_LEN, "%%edi");
- break;
- case X86_REG32_NONE:
- /* Ne devrait jamais arriver */
- break;
- }
- break;
-
- default:
- klen = 0;
- break;
-
- }
- break;
-
- default:
- klen = 0;
- break;
-
- }
-
- g_buffer_line_append_text(line, BLC_ASSEMBLY, key, klen, RTT_REGISTER, NULL);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = registre à consulter. *
-* *
-* Description : Indique si le registre correspond à ebp ou similaire. *
-* *
-* Retour : true si la correspondance est avérée, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool g_x86_register_is_base_pointer(const GX86Register *reg)
-{
- bool result; /* Bilan à remonter */
-
- switch (reg->size)
- {
- case MDS_8_BITS_UNSIGNED:
- case MDS_8_BITS_SIGNED:
- result = (reg->reg.reg8 == X86_REG8_CH);
- break;
- case MDS_16_BITS_UNSIGNED:
- case MDS_16_BITS_SIGNED:
- result = (reg->reg.reg16 == X86_REG16_BP);
- break;
- case MDS_32_BITS_UNSIGNED:
- case MDS_32_BITS_SIGNED:
- result = (reg->reg.reg32 == X86_REG32_EBP);
- break;
- /*
- case MDS_64_BITS_UNSIGNED:
- case MDS_64_BITS_SIGNED:
- result = (reg->reg.reg8 == X86_REG8_CH);
- break;
- */
- default:
- result = false;
-
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : reg = registre à consulter. *
-* *
-* Description : Indique si le registre correspond à esp ou similaire. *
-* *
-* Retour : true si la correspondance est avérée, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool g_x86_register_is_stack_pointer(const GX86Register *reg)
-{
- bool result; /* Bilan à remonter */
-
- switch (reg->size)
- {
- case MDS_8_BITS_UNSIGNED:
- case MDS_8_BITS_SIGNED:
- result = (reg->reg.reg8 == X86_REG8_AH);
- break;
- case MDS_16_BITS_UNSIGNED:
- case MDS_16_BITS_SIGNED:
- result = (reg->reg.reg16 == X86_REG16_SP);
- break;
- case MDS_32_BITS_UNSIGNED:
- case MDS_32_BITS_SIGNED:
- result = (reg->reg.reg32 == X86_REG32_ESP);
- break;
- /*
- case MDS_64_BITS_UNSIGNED:
- case MDS_64_BITS_SIGNED:
- result = (reg->reg.reg8 == X86_REG8_CH);
- break;
- */
- default:
- result = false;
-
- }
-
- return result;
-
-}
diff --git a/src/arch/x86/register.h b/src/arch/x86/register.h
deleted file mode 100644
index c8fb87c..0000000
--- a/src/arch/x86/register.h
+++ /dev/null
@@ -1,72 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * register.h - prototypes pour les aides auxiliaires relatives aux registres x86
- *
- * Copyright (C) 2012-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide 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.
- *
- * Chrysalide 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_X86_REGISTER_H
-#define _ARCH_X86_REGISTER_H
-
-
-#include <glib-object.h>
-#include <stdbool.h>
-
-
-#include "../archbase.h"
-#include "../../glibext/gbufferline.h"
-
-
-
-#define G_TYPE_X86_REGISTER g_x86_register_get_type()
-#define G_X86_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_x86_register_get_type(), GX86Register))
-#define G_IS_X86_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_x86_register_get_type()))
-#define G_X86_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_X86_REGISTER, GX86RegisterClass))
-#define G_IS_X86_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_X86_REGISTER))
-#define G_X86_REGISTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_X86_REGISTER, GX86RegisterClass))
-
-
-/* Représentation d'un registre x86 (instance) */
-typedef struct _GX86Register GX86Register;
-
-/* Représentation d'un registre x86 (classe) */
-typedef struct _GX86RegisterClass GX86RegisterClass;
-
-
-/* Indique le type défini pour une représentation d'un registre x86. */
-GType g_x86_register_get_type(void);
-
-/* Crée une réprésentation de registre x86. */
-GX86Register *g_x86_register_new(MemoryDataSize, bin_t);
-
-/* Compare un registre avec un autre. */
-bool g_x86_register_compare(const GX86Register *, const GX86Register *);
-
-/* Traduit un registre en version humainement lisible. */
-void g_x86_pool_operand_print(const GX86Register *, GBufferLine *, AsmSyntax);
-
-/* Indique si le registre correspond à ebp ou similaire. */
-bool g_x86_register_is_base_pointer(const GX86Register *);
-
-/* Indique si le registre correspond à esp ou similaire. */
-bool g_x86_register_is_stack_pointer(const GX86Register *);
-
-
-
-#endif /* _ARCH_X86_REGISTER_H */