diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-12-21 23:40:33 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-12-21 23:40:33 (GMT) |
commit | 1afa697df89c43e78d35363e68a83a6e5ddd2120 (patch) | |
tree | 55cc44fd1c85432bed412885c43d69a67bf2a09a /src/plugins/pyoida/pyoida.c | |
parent | 3bfff245c47c4dd1404c5ea7af0ff4858ac8d130 (diff) |
Deleted old useless files.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@309 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/plugins/pyoida/pyoida.c')
-rw-r--r-- | src/plugins/pyoida/pyoida.c | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/src/plugins/pyoida/pyoida.c b/src/plugins/pyoida/pyoida.c deleted file mode 100644 index 26624b2..0000000 --- a/src/plugins/pyoida/pyoida.c +++ /dev/null @@ -1,131 +0,0 @@ - -/* OpenIDA - Outil d'analyse de fichiers binaires - * pyoida.c - plugin permettant des extensions en Python - * - * Copyright (C) 2009 Cyrille Bagard - * - * This file is part of OpenIDA. - * - * 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 <http://www.gnu.org/licenses/>. - */ - - -#include "pyoida.h" - - - -#include <Python.h> - - -#include "py_binary.h" -#include "py_log.h" - - -static GObject *_ref = NULL; - - - -static PyObject *pyoida_get_current_binary(PyObject *self, PyObject *args) -{ - openida_binary *binary; /* Structure à copier */ - - binary = (openida_binary *)g_object_get_data(_ref, "current_binary"); - - return pybinary_new_from_existing(binary); - -} - -static PyMethodDef SpamMethods[] = { - {"current_binary", pyoida_get_current_binary, METH_NOARGS, - "Give the current analyzed binary."}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - - - - - - - - - - - - - -/****************************************************************************** -* * -* Paramètres : ref = espace de référencement global. * -* * -* Description : Initialise le greffon permettant l'usage de Python. * -* * -* Retour : true. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool init_plugin(GObject *ref) -{ - - printf("Init pyoida\n"); - - _ref = ref; - - return true; - -} - - -#if PY_VERSION_HEX >= 0x03000000 - -/* Python 3.x code */ - -static struct PyModuleDef spammodule = { - PyModuleDef_HEAD_INIT, - "pyoida", /* name of module */ - "pyoida_doc", /* module documentation, may be NULL */ - -1, /* size of per-interpreter state of the module, - or -1 if the module keeps state in global variables. */ - SpamMethods -}; - -PyMODINIT_FUNC -PyInit_pyoida(void) -{ - printf("Passage 3\n"); - (void) PyModule_Create(&spammodule); -} - -#else - -/* Python 2.x code */ - - -PyMODINIT_FUNC -initpyoida(void) -{ - PyObject *module; - - - printf("Passage 2\n"); - module = Py_InitModule("pyoida", SpamMethods); - - add_binary_to_python_module(module); - add_line_to_python_module(module); - add_log_to_python_module(module); - -} - -#endif |