/* Chrysalide - Outil d'analyse de fichiers binaires * instruction.c - gestion des instructions de la ARM * * Copyright (C) 2013 Cyrille Bagard * * This file is part of Chrysalide. * * OpenIDA is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * OpenIDA is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Foobar. If not, see . */ #include "instruction.h" #include "instruction-int.h" /* Initialise la classe des instructions pour Arm. */ static void g_arm_instruction_class_init(GArmInstructionClass *); /* Initialise une instance d'opérande d'architecture Arm. */ static void g_arm_instruction_init(GArmInstruction *); /* Indique le type défini pour une instruction d'architecture Arm. */ G_DEFINE_TYPE(GArmInstruction, g_arm_instruction, G_TYPE_ARCH_INSTRUCTION); /****************************************************************************** * * * Paramètres : klass = classe à initialiser. * * * * Description : Initialise la classe des instructions pour ARM. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void g_arm_instruction_class_init(GArmInstructionClass *klass) { } /****************************************************************************** * * * Paramètres : instr = instance à initialiser. * * * * Description : Initialise une instance d'instruction d'architecture ARM. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void g_arm_instruction_init(GArmInstruction *instr) { GArchInstruction *parent; /* Instance parente */ parent = G_ARCH_INSTRUCTION(instr); /* ... TODO ! */ } /* ---------------------------------------------------------------------------------- */ /* AIDE A LA MISE EN PLACE D'INSTRUCTIONS */ /* ---------------------------------------------------------------------------------- */ #if 0 /****************************************************************************** * * * Paramètres : data = flux de données à analyser. * * pos = position courante dans ce flux. * * end = limite des données à analyser. * * * * Description : Recherche l'identifiant de la prochaine instruction. * * * * Retour : Identifiant de la prochaine instruction à tenter de charger. * * * * Remarques : - * * * ******************************************************************************/ ArmOpcodes arm_guess_next_instruction(const bin_t *data, off_t pos, off_t end) { ArmOpcodes result; /* Identifiant à retourner */ result = (ArmOpcodes)data[pos]; /* Si l'instruction est marquée comme non utilisée... */ if (_instructions[result].keyword == NULL) result = DOP_COUNT; return result; } #endif