diff options
Diffstat (limited to 'plugins/pychrysa/arch/arm')
-rw-r--r-- | plugins/pychrysa/arch/arm/Makefile.am | 20 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/instruction.c | 111 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/instruction.h | 42 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/module.c | 96 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/module.h | 39 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/processor.c | 108 | ||||
-rw-r--r-- | plugins/pychrysa/arch/arm/processor.h | 42 | ||||
-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 |
14 files changed, 0 insertions, 907 deletions
diff --git a/plugins/pychrysa/arch/arm/Makefile.am b/plugins/pychrysa/arch/arm/Makefile.am deleted file mode 100644 index b081061..0000000 --- a/plugins/pychrysa/arch/arm/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ - -noinst_LTLIBRARIES = libpychrysaarcharm.la - -libpychrysaarcharm_la_SOURCES = \ - instruction.h instruction.c \ - module.h module.c \ - processor.h processor.c - -libpychrysaarcharm_la_LIBADD = \ - v7/libpychrysaarcharmv7.la - -libpychrysaarcharm_la_LDFLAGS = - - -AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBPYTHON_CFLAGS) $(LIBPYGOBJECT_CFLAGS) \ - -I../../../../src - -AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS) - -SUBDIRS = v7 diff --git a/plugins/pychrysa/arch/arm/instruction.c b/plugins/pychrysa/arch/arm/instruction.c deleted file mode 100644 index 7c5f41d..0000000 --- a/plugins/pychrysa/arch/arm/instruction.c +++ /dev/null @@ -1,111 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * instruction.c - équivalent Python du fichier "arch/arm/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/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_arm_instruction_type(void) -{ - static PyMethodDef py_arm_instruction_methods[] = { - { NULL } - }; - - static PyGetSetDef py_arm_instruction_getseters[] = { - { NULL } - }; - - static PyTypeObject py_arm_instruction_type = { - - PyVarObject_HEAD_INIT(NULL, 0) - - .tp_name = "pychrysalide.arch.arm.ArmInstruction", - .tp_basicsize = sizeof(PyGObject), - - .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, - - .tp_doc = "PyChrysalide instruction for an ARM architecture.", - - .tp_methods = py_arm_instruction_methods, - .tp_getset = py_arm_instruction_getseters, - - }; - - return &py_arm_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_arm_instruction(PyObject *module) -{ - PyTypeObject *py_arm_instruction_type; /* Type Python 'BinContent' */ - PyObject *dict; /* Dictionnaire du module */ - - py_arm_instruction_type = get_python_arm_instruction_type(); - - APPLY_ABSTRACT_FLAG(py_arm_instruction_type); - - dict = PyModule_GetDict(module); - - if (!register_class_for_pygobject(dict, G_TYPE_ARM_INSTRUCTION, - py_arm_instruction_type, get_python_arch_instruction_type())) - return false; - - return true; - -} diff --git a/plugins/pychrysa/arch/arm/instruction.h b/plugins/pychrysa/arch/arm/instruction.h deleted file mode 100644 index c10c41c..0000000 --- a/plugins/pychrysa/arch/arm/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/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_INSTRUCTION_H -#define _PLUGINS_PYCHRYSALIDE_ARCH_ARM_INSTRUCTION_H - - -#include <Python.h> -#include <stdbool.h> - - - -/* Fournit un accès à une définition de type à diffuser. */ -PyTypeObject *get_python_arm_instruction_type(void); - -/* Prend en charge l'objet 'pychrysalide.arch.arm.ArmInstruction'. */ -bool register_python_arm_instruction(PyObject *); - - - -#endif /* _PLUGINS_PYCHRYSALIDE_ARCH_ARM_INSTRUCTION_H */ diff --git a/plugins/pychrysa/arch/arm/module.c b/plugins/pychrysa/arch/arm/module.c deleted file mode 100644 index 7036449..0000000 --- a/plugins/pychrysa/arch/arm/module.c +++ /dev/null @@ -1,96 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * module.c - intégration du répertoire arm 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" -#include "v7/module.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_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_arm_module = { - - .m_base = PyModuleDef_HEAD_INIT, - - .m_name = "pychrysalide.arch.arm", - .m_doc = "Python module for Chrysalide.arch.arm", - - .m_size = -1, - - }; - - result = false; - - module = PyModule_Create(&py_chrysalide_arm_module); - if (module == NULL) return false; - - ret = PyState_AddModule(super, &py_chrysalide_arm_module); - if (ret != 0) goto aaamtpm_exit; - - ret = _PyImport_FixupBuiltin(module, "pychrysalide.arch.arm"); - if (ret != 0) goto aaamtpm_exit; - - Py_INCREF(module); - ret = PyModule_AddObject(super, "arm", module); - if (ret != 0) goto aaamtpm_exit; - - result = true; - - result &= register_python_arm_instruction(module); - result &= register_python_arm_processor(module); - - result &= add_arch_arm_v7_module_to_python_module(module); - - aaamtpm_exit: - - if (!result) - { - printf("something went wrong in %s...\n", __FUNCTION__); - /* ... */ - - } - - return result; - -} diff --git a/plugins/pychrysa/arch/arm/module.h b/plugins/pychrysa/arch/arm/module.h deleted file mode 100644 index 9a945e7..0000000 --- a/plugins/pychrysa/arch/arm/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 arm 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_MODULE_H -#define _PLUGINS_PYCHRYSALIDE_ARCH_ARM_MODULE_H - - -#include <Python.h> -#include <stdbool.h> - - - -/* Ajoute le module 'arm' au module Python. */ -bool add_arch_arm_module_to_python_module(PyObject *); - - - -#endif /* _PLUGINS_PYCHRYSALIDE_ARCH_ARM_MODULE_H */ diff --git a/plugins/pychrysa/arch/arm/processor.c b/plugins/pychrysa/arch/arm/processor.c deleted file mode 100644 index 32cdf0c..0000000 --- a/plugins/pychrysa/arch/arm/processor.c +++ /dev/null @@ -1,108 +0,0 @@ - -/* Chrysalide - Outil d'analyse de fichiers binaires - * processor.c - équivalent Python du fichier "arch/arm/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/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_arm_processor_type(void) -{ - static PyMethodDef py_arm_processor_methods[] = { - { NULL } - }; - - static PyGetSetDef py_arm_processor_getseters[] = { - { NULL } - }; - - static PyTypeObject py_arm_processor_type = { - - PyVarObject_HEAD_INIT(NULL, 0) - - .tp_name = "pychrysalide.arch.arm.ArmProcessor", - .tp_basicsize = sizeof(PyGObject), - - .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, - - .tp_doc = "PyChrysalide processor for an ARM architecture.", - - .tp_methods = py_arm_processor_methods, - .tp_getset = py_arm_processor_getseters, - - }; - - return &py_arm_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_arm_processor(PyObject *module) -{ - PyTypeObject *py_arm_processor_type; /* Type Python 'BinContent' */ - PyObject *dict; /* Dictionnaire du module */ - - py_arm_processor_type = get_python_arm_processor_type(); - - dict = PyModule_GetDict(module); - - if (!register_class_for_pygobject(dict, G_TYPE_ARM_PROCESSOR, py_arm_processor_type, get_python_arch_processor_type())) - return false; - - return true; - -} diff --git a/plugins/pychrysa/arch/arm/processor.h b/plugins/pychrysa/arch/arm/processor.h deleted file mode 100644 index 5039e7b..0000000 --- a/plugins/pychrysa/arch/arm/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/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_PROCESSOR_H -#define _PLUGINS_PYCHRYSALIDE_ARCH_ARM_PROCESSOR_H - - -#include <Python.h> -#include <stdbool.h> - - - -/* Fournit un accès à une définition de type à diffuser. */ -PyTypeObject *get_python_arm_processor_type(void); - -/* Prend en charge l'objet 'pychrysalide.arch.arm.ArmProcessor'. */ -bool register_python_arm_processor(PyObject *); - - - -#endif /* _PLUGINS_PYCHRYSALIDE_ARCH_ARM_PROCESSOR_H */ 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 */ |