diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-12-02 11:04:35 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-12-02 11:04:35 (GMT) |
commit | 2c988d3ec52cc4c949a35aca7ef335dac773df92 (patch) | |
tree | fe650d2fc8ddceb606abdf0d2e14e5ef6596be82 /plugins/pychrysa/arch/arm/v7 | |
parent | 23abef53590bf3dd6f88ff4dbe81e306abfa4386 (diff) |
Created a plugin for the ARM support.
Diffstat (limited to 'plugins/pychrysa/arch/arm/v7')
-rw-r--r-- | plugins/pychrysa/arch/arm/v7/Makefile.am | 16 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/v7/instruction.c | 109 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/v7/instruction.h | 42 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/v7/module.c | 93 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/v7/module.h | 39 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/v7/processor.c | 108 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/v7/processor.h | 42 |
7 files changed, 0 insertions, 449 deletions
diff --git a/plugins/pychrysa/arch/arm/v7/Makefile.am b/plugins/pychrysa/arch/arm/v7/Makefile.am deleted file mode 100644 index d95aff3..0000000 --- a/plugins/pychrysa/arch/arm/v7/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -noinst_LTLIBRARIES = libpychrysaarcharmv7.la - -libpychrysaarcharmv7_la_SOURCES = \ - instruction.h instruction.c \ - module.h module.c \ - processor.h processor.c - - -libpychrysaarcharmv7_la_LDFLAGS = - - -AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBPYTHON_CFLAGS) $(LIBPYGOBJECT_CFLAGS) \ - -I../../../../../src - -AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS) diff --git a/plugins/pychrysa/arch/arm/v7/instruction.c b/plugins/pychrysa/arch/arm/v7/instruction.c deleted file mode 100644 index 2964f16..0000000 --- a/plugins/pychrysa/arch/arm/v7/instruction.c +++ /dev/null @@ -1,109 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * instruction.c - équivalent Python du fichier "arch/arm/v7/instruction.c" - * - * Copyright (C) 2015-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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "instruction.h" - - -#include <pygobject.h> - - -#include <arch/arm/v7/instruction.h> - - -#include "../instruction.h" -#include "../../../helpers.h" - - - -/****************************************************************************** -* * -* Paramètres : - * -* * -* Description : Fournit un accès à une définition de type à diffuser. * -* * -* Retour : Définition d'objet pour Python. * -* * -* Remarques : - * -* * -******************************************************************************/ - -PyTypeObject *get_python_armv7_instruction_type(void) -{ - static PyMethodDef py_armv7_instruction_methods[] = { - { NULL } - }; - - static PyGetSetDef py_armv7_instruction_getseters[] = { - { NULL } - }; - - static PyTypeObject py_armv7_instruction_type = { - - PyVarObject_HEAD_INIT(NULL, 0) - - .tp_name = "pychrysalide.arch.arm.v7.ArmV7Instruction", - .tp_basicsize = sizeof(PyGObject), - - .tp_flags = Py_TPFLAGS_DEFAULT, - - .tp_doc = "PyChrysalide instruction for an ARMv7 architecture.", - - .tp_methods = py_armv7_instruction_methods, - .tp_getset = py_armv7_instruction_getseters, - - }; - - return &py_armv7_instruction_type; - -} - - -/****************************************************************************** -* * -* Paramètres : module = module dont la définition est à compléter. * -* * -* Description : Prend en charge l'objet 'pychrysalide....arm.ArmInstruction'.* -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool register_python_armv7_instruction(PyObject *module) -{ - PyTypeObject *py_armv7_instruction_type;/* Type Python 'BinContent' */ - PyObject *dict; /* Dictionnaire du module */ - - py_armv7_instruction_type = get_python_armv7_instruction_type(); - - dict = PyModule_GetDict(module); - - if (!register_class_for_pygobject(dict, G_TYPE_ARMV7_INSTRUCTION, - py_armv7_instruction_type, get_python_arm_instruction_type())) - return false; - - return true; - -} diff --git a/plugins/pychrysa/arch/arm/v7/instruction.h b/plugins/pychrysa/arch/arm/v7/instruction.h deleted file mode 100644 index cf10039..0000000 --- a/plugins/pychrysa/arch/arm/v7/instruction.h +++ /dev/null @@ -1,42 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * instruction.h - prototypes pour l'équivalent Python du fichier "arch/arm/v7/instruction.h" - * - * Copyright (C) 2015-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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_INSTRUCTION_H -#define _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_INSTRUCTION_H - - -#include <Python.h> -#include <stdbool.h> - - - -/* Fournit un accès à une définition de type à diffuser. */ -PyTypeObject *get_python_armv7_instruction_type(void); - -/* Prend en charge l'objet 'pychrysalide.arch.arm.v7.ArmV7Instruction'. */ -bool register_python_armv7_instruction(PyObject *); - - - -#endif /* _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_INSTRUCTION_H */ diff --git a/plugins/pychrysa/arch/arm/v7/module.c b/plugins/pychrysa/arch/arm/v7/module.c deleted file mode 100644 index 9188ae4..0000000 --- a/plugins/pychrysa/arch/arm/v7/module.c +++ /dev/null @@ -1,93 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * module.c - intégration du répertoire v7 en tant que module - * - * Copyright (C) 2015-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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "module.h" - - -#include "instruction.h" -#include "processor.h" - - - -/****************************************************************************** -* * -* Paramètres : module = module dont la définition est à compléter. * -* * -* Description : Ajoute le module 'arm' au module Python. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool add_arch_arm_v7_module_to_python_module(PyObject *super) -{ - bool result; /* Bilan à retourner */ - PyObject *module; /* Sous-module mis en place */ - int ret; /* Bilan d'un appel */ - - static PyModuleDef py_chrysalide_v7_module = { - - .m_base = PyModuleDef_HEAD_INIT, - - .m_name = "pychrysalide.arch.arm.v7", - .m_doc = "Python module for Chrysalide.arch.arm.v7", - - .m_size = -1, - - }; - - result = false; - - module = PyModule_Create(&py_chrysalide_v7_module); - if (module == NULL) return false; - - ret = PyState_AddModule(super, &py_chrysalide_v7_module); - if (ret != 0) goto aaamtpm_exit; - - ret = _PyImport_FixupBuiltin(module, "pychrysalide.arch.arm.v7"); - if (ret != 0) goto aaamtpm_exit; - - Py_INCREF(module); - ret = PyModule_AddObject(super, "v7", module); - if (ret != 0) goto aaamtpm_exit; - - result = true; - - result &= register_python_armv7_instruction(module); - result &= register_python_armv7_processor(module); - - aaamtpm_exit: - - if (!result) - { - printf("something went wrong in %s...\n", __FUNCTION__); - /* ... */ - - } - - return result; - -} diff --git a/plugins/pychrysa/arch/arm/v7/module.h b/plugins/pychrysa/arch/arm/v7/module.h deleted file mode 100644 index 18e7d47..0000000 --- a/plugins/pychrysa/arch/arm/v7/module.h +++ /dev/null @@ -1,39 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * module.h - prototypes pour l'intégration du répertoire v7 en tant que module - * - * Copyright (C) 2015-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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_MODULE_H -#define _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_MODULE_H - - -#include <Python.h> -#include <stdbool.h> - - - -/* Ajoute le module 'arm' au module Python. */ -bool add_arch_arm_v7_module_to_python_module(PyObject *); - - - -#endif /* _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_MODULE_H */ diff --git a/plugins/pychrysa/arch/arm/v7/processor.c b/plugins/pychrysa/arch/arm/v7/processor.c deleted file mode 100644 index cd0e9eb..0000000 --- a/plugins/pychrysa/arch/arm/v7/processor.c +++ /dev/null @@ -1,108 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * processor.c - équivalent Python du fichier "arch/arm/v7/processor.c" - * - * Copyright (C) 2015-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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "processor.h" - - -#include <pygobject.h> - - -#include <arch/arm/v7/processor.h> - - -#include "../processor.h" -#include "../../../helpers.h" - - - -/****************************************************************************** -* * -* Paramètres : - * -* * -* Description : Fournit un accès à une définition de type à diffuser. * -* * -* Retour : Définition d'objet pour Python. * -* * -* Remarques : - * -* * -******************************************************************************/ - -PyTypeObject *get_python_armv7_processor_type(void) -{ - static PyMethodDef py_armv7_processor_methods[] = { - { NULL } - }; - - static PyGetSetDef py_armv7_processor_getseters[] = { - { NULL } - }; - - static PyTypeObject py_armv7_processor_type = { - - PyVarObject_HEAD_INIT(NULL, 0) - - .tp_name = "pychrysalide.arch.arm.v7.ArmV7Processor", - .tp_basicsize = sizeof(PyGObject), - - .tp_flags = Py_TPFLAGS_DEFAULT, - - .tp_doc = "PyChrysalide processor for an ARMv7 architecture.", - - .tp_methods = py_armv7_processor_methods, - .tp_getset = py_armv7_processor_getseters, - - }; - - return &py_armv7_processor_type; - -} - - -/****************************************************************************** -* * -* Paramètres : module = module dont la définition est à compléter. * -* * -* Description : Prend en charge l'objet 'pychrysalide.arch.arm.ArmProcessor'.* -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool register_python_armv7_processor(PyObject *module) -{ - PyTypeObject *py_armv7_processor_type; /* Type Python 'BinContent' */ - PyObject *dict; /* Dictionnaire du module */ - - py_armv7_processor_type = get_python_armv7_processor_type(); - - dict = PyModule_GetDict(module); - - if (!register_class_for_pygobject(dict, G_TYPE_ARMV7_PROCESSOR, py_armv7_processor_type, get_python_arm_processor_type())) - return false; - - return true; - -} diff --git a/plugins/pychrysa/arch/arm/v7/processor.h b/plugins/pychrysa/arch/arm/v7/processor.h deleted file mode 100644 index 6d7cb4a..0000000 --- a/plugins/pychrysa/arch/arm/v7/processor.h +++ /dev/null @@ -1,42 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * processor.h - prototypes pour l'équivalent Python du fichier "arch/arm/v7/processor.h" - * - * Copyright (C) 2015-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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_PROCESSOR_H -#define _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_PROCESSOR_H - - -#include <Python.h> -#include <stdbool.h> - - - -/* Fournit un accès à une définition de type à diffuser. */ -PyTypeObject *get_python_armv7_processor_type(void); - -/* Prend en charge l'objet 'pychrysalide.arch.arm.v7.ArmV7Processor'. */ -bool register_python_armv7_processor(PyObject *); - - - -#endif /* _PLUGINS_PYCHRYSALIDE_ARCH_ARM_V7_PROCESSOR_H */ |