diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-03-17 20:29:47 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-03-17 20:29:47 (GMT) |
commit | bbad297e902022ecac9fab21c01dc109560db8eb (patch) | |
tree | 6d9703e7dda8c0a61b0a3a015be89612df3bf198 /plugins | |
parent | d1f5881c1f4ad53781fdadfe5ce6cac24cee3bab (diff) |
Created the 'pychrysa' Python plugin from the 'pyoida' one.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@240 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Makefile.am | 2 | ||||
-rw-r--r-- | plugins/pychrysa/Makefile.am (renamed from plugins/pyoida/Makefile.am) | 18 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/Makefile.am (renamed from plugins/pyoida/analysis/Makefile.am) | 6 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/binary.c (renamed from plugins/pyoida/analysis/binary.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/binary.h (renamed from plugins/pyoida/analysis/binary.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/exporter-int.h (renamed from plugins/pyoida/analysis/exporter-int.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/exporter.c (renamed from plugins/pyoida/analysis/exporter.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/exporter.h (renamed from plugins/pyoida/analysis/exporter.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/line.c (renamed from plugins/pyoida/analysis/line.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/line.h (renamed from plugins/pyoida/analysis/line.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/module.c (renamed from plugins/pyoida/analysis/module.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/module.h (renamed from plugins/pyoida/analysis/module.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_binary.c (renamed from plugins/pyoida/analysis/py_binary.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_binary.h (renamed from plugins/pyoida/analysis/py_binary.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_line-int.h (renamed from plugins/pyoida/analysis/py_line-int.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_line.c (renamed from plugins/pyoida/analysis/py_line.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_line.h (renamed from plugins/pyoida/analysis/py_line.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_line_code.c (renamed from plugins/pyoida/analysis/py_line_code.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_line_code.h (renamed from plugins/pyoida/analysis/py_line_code.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/roptions.c (renamed from plugins/pyoida/analysis/roptions.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/roptions.h (renamed from plugins/pyoida/analysis/roptions.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/arch/Makefile.am (renamed from plugins/pyoida/arch/Makefile.am) | 6 | ||||
-rw-r--r-- | plugins/pychrysa/arch/archbase.c (renamed from plugins/pyoida/arch/archbase.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/arch/archbase.h (renamed from plugins/pyoida/arch/archbase.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/arch/module.c (renamed from plugins/pyoida/arch/module.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/arch/module.h (renamed from plugins/pyoida/arch/module.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/arch/processor.c (renamed from plugins/pyoida/arch/processor.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/arch/processor.h (renamed from plugins/pyoida/arch/processor.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/debug/Makefile.am (renamed from plugins/pyoida/debug/Makefile.am) | 6 | ||||
-rw-r--r-- | plugins/pychrysa/debug/debugger.c (renamed from plugins/pyoida/debug/debugger.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/debug/debugger.h (renamed from plugins/pyoida/debug/debugger.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/debug/module.c (renamed from plugins/pyoida/debug/module.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/debug/module.h (renamed from plugins/pyoida/debug/module.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/format/Makefile.am (renamed from plugins/pyoida/format/Makefile.am) | 6 | ||||
-rw-r--r-- | plugins/pychrysa/format/executable.c (renamed from plugins/pyoida/format/executable.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/format/executable.h (renamed from plugins/pyoida/format/executable.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/format/module.c (renamed from plugins/pyoida/format/module.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/format/module.h (renamed from plugins/pyoida/format/module.h) | 0 | ||||
-rwxr-xr-x | plugins/pychrysa/linsyscalls/oidapgi.py (renamed from plugins/pyoida/linsyscalls/oidapgi.py) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/plugin.c (renamed from plugins/pyoida/plugin.c) | 64 | ||||
-rw-r--r-- | plugins/pychrysa/plugin.h (renamed from plugins/pyoida/plugin.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/py_log.c (renamed from plugins/pyoida/py_log.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/py_log.h (renamed from plugins/pyoida/py_log.h) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/pychrysa.c (renamed from plugins/pyoida/pyoida.c) | 112 | ||||
-rw-r--r-- | plugins/pychrysa/pychrysa.h (renamed from plugins/pyoida/pyoida.h) | 30 | ||||
-rw-r--r-- | plugins/pychrysa/quirks.c (renamed from plugins/pyoida/quirks.c) | 0 | ||||
-rw-r--r-- | plugins/pychrysa/quirks.h (renamed from plugins/pyoida/quirks.h) | 0 | ||||
-rw-r--r-- | plugins/python/apkfiles/apkfiles.py | 2 |
48 files changed, 121 insertions, 131 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index b107964..be5740c 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = dexresolver pyoida python stackvars theseus +SUBDIRS = dexresolver pychrysa python stackvars theseus diff --git a/plugins/pyoida/Makefile.am b/plugins/pychrysa/Makefile.am index 42a2fc2..a339dab 100644 --- a/plugins/pyoida/Makefile.am +++ b/plugins/pychrysa/Makefile.am @@ -1,19 +1,19 @@ -pkglib_LTLIBRARIES = pyoida.la +pkglib_LTLIBRARIES = pychrysa.la -pyoida_la_SOURCES = \ +pychrysa_la_SOURCES = \ plugin.h plugin.c \ py_log.h py_log.c \ - pyoida.h pyoida.c \ + pychrysa.h pychrysa.c \ quirks.h quirks.c -pyoida_la_LIBADD = \ - analysis/libpyoidaanalysis.la \ - arch/libpyoidaarch.la \ - debug/libpyoidadebug.la \ - format/libpyoidaformat.la +pychrysa_la_LIBADD = \ + analysis/libpychrysaanalysis.la \ + arch/libpychrysaarch.la \ + debug/libpychrysadebug.la \ + format/libpychrysaformat.la -pyoida_la_LDFLAGS = -module -avoid-version $(LIBGTK_LIBS) $(LIBXML_LIBS) $(LIBPYTHON_LIBS) \ +pychrysa_la_LDFLAGS = -module -avoid-version $(LIBGTK_LIBS) $(LIBXML_LIBS) $(LIBPYTHON_LIBS) \ $(LIBPYGOBJECT_LIBS) \ -L../../src/panels/ -lpanels -L../../src/.libs -loidadisass -loidagtkext \ -L../../src/plugins/.libs -lplugins diff --git a/plugins/pyoida/analysis/Makefile.am b/plugins/pychrysa/analysis/Makefile.am index e67f188..b18d16d 100644 --- a/plugins/pyoida/analysis/Makefile.am +++ b/plugins/pychrysa/analysis/Makefile.am @@ -1,7 +1,7 @@ -noinst_LTLIBRARIES = libpyoidaanalysis.la +noinst_LTLIBRARIES = libpychrysaanalysis.la -libpyoidaanalysis_la_SOURCES = \ +libpychrysaanalysis_la_SOURCES = \ binary.h binary.c \ exporter-int.h \ exporter.h exporter.c \ @@ -10,7 +10,7 @@ libpyoidaanalysis_la_SOURCES = \ roptions.h roptions.c -libpyoidaanalysis_la_LDFLAGS = +libpychrysaanalysis_la_LDFLAGS = INCLUDES = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBPYTHON_CFLAGS) -I../../../src diff --git a/plugins/pyoida/analysis/binary.c b/plugins/pychrysa/analysis/binary.c index d378496..d378496 100644 --- a/plugins/pyoida/analysis/binary.c +++ b/plugins/pychrysa/analysis/binary.c diff --git a/plugins/pyoida/analysis/binary.h b/plugins/pychrysa/analysis/binary.h index 1500a06..1500a06 100644 --- a/plugins/pyoida/analysis/binary.h +++ b/plugins/pychrysa/analysis/binary.h diff --git a/plugins/pyoida/analysis/exporter-int.h b/plugins/pychrysa/analysis/exporter-int.h index 2498d4b..2498d4b 100644 --- a/plugins/pyoida/analysis/exporter-int.h +++ b/plugins/pychrysa/analysis/exporter-int.h diff --git a/plugins/pyoida/analysis/exporter.c b/plugins/pychrysa/analysis/exporter.c index 8c49542..8c49542 100644 --- a/plugins/pyoida/analysis/exporter.c +++ b/plugins/pychrysa/analysis/exporter.c diff --git a/plugins/pyoida/analysis/exporter.h b/plugins/pychrysa/analysis/exporter.h index 4668934..4668934 100644 --- a/plugins/pyoida/analysis/exporter.h +++ b/plugins/pychrysa/analysis/exporter.h diff --git a/plugins/pyoida/analysis/line.c b/plugins/pychrysa/analysis/line.c index fd697e2..fd697e2 100644 --- a/plugins/pyoida/analysis/line.c +++ b/plugins/pychrysa/analysis/line.c diff --git a/plugins/pyoida/analysis/line.h b/plugins/pychrysa/analysis/line.h index e71596c..e71596c 100644 --- a/plugins/pyoida/analysis/line.h +++ b/plugins/pychrysa/analysis/line.h diff --git a/plugins/pyoida/analysis/module.c b/plugins/pychrysa/analysis/module.c index 8f07002..8f07002 100644 --- a/plugins/pyoida/analysis/module.c +++ b/plugins/pychrysa/analysis/module.c diff --git a/plugins/pyoida/analysis/module.h b/plugins/pychrysa/analysis/module.h index a8bd329..a8bd329 100644 --- a/plugins/pyoida/analysis/module.h +++ b/plugins/pychrysa/analysis/module.h diff --git a/plugins/pyoida/analysis/py_binary.c b/plugins/pychrysa/analysis/py_binary.c index 04d4881..04d4881 100644 --- a/plugins/pyoida/analysis/py_binary.c +++ b/plugins/pychrysa/analysis/py_binary.c diff --git a/plugins/pyoida/analysis/py_binary.h b/plugins/pychrysa/analysis/py_binary.h index f87d2a5..f87d2a5 100644 --- a/plugins/pyoida/analysis/py_binary.h +++ b/plugins/pychrysa/analysis/py_binary.h diff --git a/plugins/pyoida/analysis/py_line-int.h b/plugins/pychrysa/analysis/py_line-int.h index 408eae8..408eae8 100644 --- a/plugins/pyoida/analysis/py_line-int.h +++ b/plugins/pychrysa/analysis/py_line-int.h diff --git a/plugins/pyoida/analysis/py_line.c b/plugins/pychrysa/analysis/py_line.c index e981dbe..e981dbe 100644 --- a/plugins/pyoida/analysis/py_line.c +++ b/plugins/pychrysa/analysis/py_line.c diff --git a/plugins/pyoida/analysis/py_line.h b/plugins/pychrysa/analysis/py_line.h index 681e13b..681e13b 100644 --- a/plugins/pyoida/analysis/py_line.h +++ b/plugins/pychrysa/analysis/py_line.h diff --git a/plugins/pyoida/analysis/py_line_code.c b/plugins/pychrysa/analysis/py_line_code.c index 26fe513..26fe513 100644 --- a/plugins/pyoida/analysis/py_line_code.c +++ b/plugins/pychrysa/analysis/py_line_code.c diff --git a/plugins/pyoida/analysis/py_line_code.h b/plugins/pychrysa/analysis/py_line_code.h index 8a67b44..8a67b44 100644 --- a/plugins/pyoida/analysis/py_line_code.h +++ b/plugins/pychrysa/analysis/py_line_code.h diff --git a/plugins/pyoida/analysis/roptions.c b/plugins/pychrysa/analysis/roptions.c index 57a4f52..57a4f52 100644 --- a/plugins/pyoida/analysis/roptions.c +++ b/plugins/pychrysa/analysis/roptions.c diff --git a/plugins/pyoida/analysis/roptions.h b/plugins/pychrysa/analysis/roptions.h index 0897211..0897211 100644 --- a/plugins/pyoida/analysis/roptions.h +++ b/plugins/pychrysa/analysis/roptions.h diff --git a/plugins/pyoida/arch/Makefile.am b/plugins/pychrysa/arch/Makefile.am index d0113ec..6ab3332 100644 --- a/plugins/pyoida/arch/Makefile.am +++ b/plugins/pychrysa/arch/Makefile.am @@ -1,13 +1,13 @@ -noinst_LTLIBRARIES = libpyoidaarch.la +noinst_LTLIBRARIES = libpychrysaarch.la -libpyoidaarch_la_SOURCES = \ +libpychrysaarch_la_SOURCES = \ archbase.h archbase.c \ module.h module.c \ processor.h processor.c -libpyoidaarch_la_LDFLAGS = +libpychrysaarch_la_LDFLAGS = INCLUDES = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBPYTHON_CFLAGS) -I../../../src diff --git a/plugins/pyoida/arch/archbase.c b/plugins/pychrysa/arch/archbase.c index b73e769..b73e769 100644 --- a/plugins/pyoida/arch/archbase.c +++ b/plugins/pychrysa/arch/archbase.c diff --git a/plugins/pyoida/arch/archbase.h b/plugins/pychrysa/arch/archbase.h index ca621aa..ca621aa 100644 --- a/plugins/pyoida/arch/archbase.h +++ b/plugins/pychrysa/arch/archbase.h diff --git a/plugins/pyoida/arch/module.c b/plugins/pychrysa/arch/module.c index 59b0c2c..59b0c2c 100644 --- a/plugins/pyoida/arch/module.c +++ b/plugins/pychrysa/arch/module.c diff --git a/plugins/pyoida/arch/module.h b/plugins/pychrysa/arch/module.h index 4ae3447..4ae3447 100644 --- a/plugins/pyoida/arch/module.h +++ b/plugins/pychrysa/arch/module.h diff --git a/plugins/pyoida/arch/processor.c b/plugins/pychrysa/arch/processor.c index 0a3fe95..0a3fe95 100644 --- a/plugins/pyoida/arch/processor.c +++ b/plugins/pychrysa/arch/processor.c diff --git a/plugins/pyoida/arch/processor.h b/plugins/pychrysa/arch/processor.h index 032d82d..032d82d 100644 --- a/plugins/pyoida/arch/processor.h +++ b/plugins/pychrysa/arch/processor.h diff --git a/plugins/pyoida/debug/Makefile.am b/plugins/pychrysa/debug/Makefile.am index 4f01701..3ed4348 100644 --- a/plugins/pyoida/debug/Makefile.am +++ b/plugins/pychrysa/debug/Makefile.am @@ -1,12 +1,12 @@ -noinst_LTLIBRARIES = libpyoidadebug.la +noinst_LTLIBRARIES = libpychrysadebug.la -libpyoidadebug_la_SOURCES = \ +libpychrysadebug_la_SOURCES = \ debugger.h debugger.c \ module.h module.c -libpyoidadebug_la_LDFLAGS = +libpychrysadebug_la_LDFLAGS = INCLUDES = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBPYTHON_CFLAGS) $(LIBPYGOBJECT_CFLAGS) \ diff --git a/plugins/pyoida/debug/debugger.c b/plugins/pychrysa/debug/debugger.c index 3e42ab7..3e42ab7 100644 --- a/plugins/pyoida/debug/debugger.c +++ b/plugins/pychrysa/debug/debugger.c diff --git a/plugins/pyoida/debug/debugger.h b/plugins/pychrysa/debug/debugger.h index 5e5cc21..5e5cc21 100644 --- a/plugins/pyoida/debug/debugger.h +++ b/plugins/pychrysa/debug/debugger.h diff --git a/plugins/pyoida/debug/module.c b/plugins/pychrysa/debug/module.c index 7537dc7..7537dc7 100644 --- a/plugins/pyoida/debug/module.c +++ b/plugins/pychrysa/debug/module.c diff --git a/plugins/pyoida/debug/module.h b/plugins/pychrysa/debug/module.h index d331621..d331621 100644 --- a/plugins/pyoida/debug/module.h +++ b/plugins/pychrysa/debug/module.h diff --git a/plugins/pyoida/format/Makefile.am b/plugins/pychrysa/format/Makefile.am index 74d3e3a..a890385 100644 --- a/plugins/pyoida/format/Makefile.am +++ b/plugins/pychrysa/format/Makefile.am @@ -1,12 +1,12 @@ -noinst_LTLIBRARIES = libpyoidaformat.la +noinst_LTLIBRARIES = libpychrysaformat.la -libpyoidaformat_la_SOURCES = \ +libpychrysaformat_la_SOURCES = \ executable.h executable.c \ module.h module.c -libpyoidaformat_la_LDFLAGS = +libpychrysaformat_la_LDFLAGS = INCLUDES = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBPYTHON_CFLAGS) -I../../../src diff --git a/plugins/pyoida/format/executable.c b/plugins/pychrysa/format/executable.c index 2f10f71..2f10f71 100644 --- a/plugins/pyoida/format/executable.c +++ b/plugins/pychrysa/format/executable.c diff --git a/plugins/pyoida/format/executable.h b/plugins/pychrysa/format/executable.h index 577d1f9..577d1f9 100644 --- a/plugins/pyoida/format/executable.h +++ b/plugins/pychrysa/format/executable.h diff --git a/plugins/pyoida/format/module.c b/plugins/pychrysa/format/module.c index 1f15d50..1f15d50 100644 --- a/plugins/pyoida/format/module.c +++ b/plugins/pychrysa/format/module.c diff --git a/plugins/pyoida/format/module.h b/plugins/pychrysa/format/module.h index 4aa95cf..4aa95cf 100644 --- a/plugins/pyoida/format/module.h +++ b/plugins/pychrysa/format/module.h diff --git a/plugins/pyoida/linsyscalls/oidapgi.py b/plugins/pychrysa/linsyscalls/oidapgi.py index dd4e010..dd4e010 100755 --- a/plugins/pyoida/linsyscalls/oidapgi.py +++ b/plugins/pychrysa/linsyscalls/oidapgi.py diff --git a/plugins/pyoida/plugin.c b/plugins/pychrysa/plugin.c index 64cf013..b04dd09 100644 --- a/plugins/pyoida/plugin.c +++ b/plugins/pychrysa/plugin.c @@ -84,11 +84,11 @@ static bool g_python_plugin_handle_debugger(const GPythonPlugin *, GBinaryDebugg /* Classe plugin pour Python */ -typedef struct _pyoida_plugin +typedef struct _pychrysa_plugin { PyObject_HEAD -} pyoida_plugin; +} pychrysa_plugin; @@ -96,25 +96,25 @@ typedef struct _pyoida_plugin /* Crée un nouveau greffon Python abstrait. */ -static PyObject *pyoida_plugin_new(PyTypeObject *, PyObject *, PyObject *); +static PyObject *pychrysa_plugin_new(PyTypeObject *, PyObject *, PyObject *); /* Exécute une action valide pour le greffon Python. */ -static PyObject *pyoida_plugin_run(PyObject *, PyObject *); +static PyObject *pychrysa_plugin_run(PyObject *, PyObject *); /* Définit les constantes pour les greffons en Python. */ -static bool pyoida_plugin_define_constants(PyObject *); +static bool pychrysa_plugin_define_constants(PyObject *); /* Définit le comportement par défaut d'un greffon Python. */ -static PyObject *pyoida_plugin_get_action(PyObject *, PyObject *); +static PyObject *pychrysa_plugin_get_action(PyObject *, PyObject *); /* Définit l'issue de la recherche d'un format par défaut. */ -static PyObject *pyoida_plugin_is_matching(PyObject *, PyObject *); +static PyObject *pychrysa_plugin_is_matching(PyObject *, PyObject *); /* Exécute une action relative à un débogueur. */ -static PyObject *pyoida_plugin_handle_debugger(PyObject *, PyObject *); +static PyObject *pychrysa_plugin_handle_debugger(PyObject *, PyObject *); @@ -595,11 +595,11 @@ static bool g_python_plugin_handle_debugger(const GPythonPlugin *plugin, GBinary * * ******************************************************************************/ -static PyObject *pyoida_plugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +static PyObject *pychrysa_plugin_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - pyoida_plugin *result; /* Instance à retourner */ + pychrysa_plugin *result; /* Instance à retourner */ - result = (pyoida_plugin *)type->tp_alloc(type, 0); + result = (pychrysa_plugin *)type->tp_alloc(type, 0); return (PyObject *)result; @@ -625,7 +625,7 @@ static PyObject *pyoida_plugin_new(PyTypeObject *type, PyObject *args, PyObject * * ******************************************************************************/ -static bool pyoida_plugin_define_constants(PyObject *dict) +static bool pychrysa_plugin_define_constants(PyObject *dict) { int ret; /* Bilan d'un ajout */ @@ -676,7 +676,7 @@ static bool pyoida_plugin_define_constants(PyObject *dict) * * ******************************************************************************/ -static PyObject *pyoida_plugin_get_action(PyObject *self, PyObject *args) +static PyObject *pychrysa_plugin_get_action(PyObject *self, PyObject *args) { return PyInt_FromLong(PGA_NONE); @@ -696,7 +696,7 @@ static PyObject *pyoida_plugin_get_action(PyObject *self, PyObject *args) * * ******************************************************************************/ -static PyObject *pyoida_plugin_is_matching(PyObject *self, PyObject *args) +static PyObject *pychrysa_plugin_is_matching(PyObject *self, PyObject *args) { PyObject *result; /* Liste à retourner */ @@ -726,7 +726,7 @@ static PyObject *pyoida_plugin_is_matching(PyObject *self, PyObject *args) * * ******************************************************************************/ -static PyObject *pyoida_plugin_handle_debugger(PyObject *self, PyObject *args) +static PyObject *pychrysa_plugin_handle_debugger(PyObject *self, PyObject *args) { Py_RETURN_TRUE; @@ -746,7 +746,7 @@ static PyObject *pyoida_plugin_handle_debugger(PyObject *self, PyObject *args) * * ******************************************************************************/ -static PyObject *pyoida_plugin_run(PyObject *self, PyObject *args) +static PyObject *pychrysa_plugin_run(PyObject *self, PyObject *args) { return Py_None; @@ -774,24 +774,24 @@ bool add_plugin_to_python_module(PyObject *module) int ret; /* Bilan d'un appel */ -static PyMethodDef pyoida_plugin_methods[] = { - { "get_action", (PyCFunction)pyoida_plugin_get_action, METH_NOARGS, +static PyMethodDef pychrysa_plugin_methods[] = { + { "get_action", (PyCFunction)pychrysa_plugin_get_action, METH_NOARGS, "Register the plugin for given actions." }, - { "is_matching", (PyCFunction)pyoida_plugin_is_matching, METH_VARARGS, + { "is_matching", (PyCFunction)pychrysa_plugin_is_matching, METH_VARARGS, "Define if the given file can be handled." }, - { "handle_debugger", (PyCFunction)pyoida_plugin_handle_debugger, METH_VARARGS, + { "handle_debugger", (PyCFunction)pychrysa_plugin_handle_debugger, METH_VARARGS, "Be notify about debugger attaching or detaching." }, - { "run", (PyCFunction)pyoida_plugin_run, METH_VARARGS, + { "run", (PyCFunction)pychrysa_plugin_run, METH_VARARGS, "Run the plugin for a specific action." }, NULL }; -static PyTypeObject pyoida_plugin_type = { +static PyTypeObject pychrysa_plugin_type = { PyObject_HEAD_INIT(NULL) @@ -800,7 +800,7 @@ static PyTypeObject pyoida_plugin_type = { #endif "plugin.Plugin", /* tp_name */ - sizeof(pyoida_plugin), /* tp_basicsize */ + sizeof(pychrysa_plugin), /* tp_basicsize */ 0, /* tp_itemsize */ 0, /* tp_dealloc */ 0, /* tp_print */ @@ -818,14 +818,14 @@ static PyTypeObject pyoida_plugin_type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "PyOIDA Plugin objects", /* tp_doc */ + "PyCHRYSA Plugin objects", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ - pyoida_plugin_methods, /* tp_methods */ + pychrysa_plugin_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ @@ -835,28 +835,24 @@ static PyTypeObject pyoida_plugin_type = { 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ - (newfunc)pyoida_plugin_new, /* tp_new */ + (newfunc)pychrysa_plugin_new, /* tp_new */ }; - printf("Adding pyoida pg type...\n"); - - if (PyType_Ready(&pyoida_plugin_type) < 0) + if (PyType_Ready(&pychrysa_plugin_type) < 0) return false; - printf("Adding pyoida pg type\n"); - - if (!pyoida_plugin_define_constants(pyoida_plugin_type.tp_dict)) + if (!pychrysa_plugin_define_constants(pychrysa_plugin_type.tp_dict)) return false; - Py_INCREF(&pyoida_plugin_type); - PyModule_AddObject(module, "Plugin", (PyObject *)&pyoida_plugin_type); + Py_INCREF(&pychrysa_plugin_type); + PyModule_AddObject(module, "Plugin", (PyObject *)&pychrysa_plugin_type); return true; /* FIXME */ diff --git a/plugins/pyoida/plugin.h b/plugins/pychrysa/plugin.h index af8445d..af8445d 100644 --- a/plugins/pyoida/plugin.h +++ b/plugins/pychrysa/plugin.h diff --git a/plugins/pyoida/py_log.c b/plugins/pychrysa/py_log.c index fde7ae5..fde7ae5 100644 --- a/plugins/pyoida/py_log.c +++ b/plugins/pychrysa/py_log.c diff --git a/plugins/pyoida/py_log.h b/plugins/pychrysa/py_log.h index 5274428..5274428 100644 --- a/plugins/pyoida/py_log.h +++ b/plugins/pychrysa/py_log.h diff --git a/plugins/pyoida/pyoida.c b/plugins/pychrysa/pychrysa.c index f3051cc..84400a1 100644 --- a/plugins/pyoida/pyoida.c +++ b/plugins/pychrysa/pychrysa.c @@ -1,6 +1,6 @@ /* OpenIDA - Outil d'analyse de fichiers binaires - * pyoida.c - plugin permettant des extensions en Python + * pychrysa.c - plugin permettant des extensions en Python * * Copyright (C) 2009-2012 Cyrille Bagard * @@ -21,15 +21,14 @@ */ -#include "pyoida.h" +#include "pychrysa.h" -#include <config.h> #include <dirent.h> +#include <pygobject.h> -#include <Python.h> -#include <pygobject.h> +#include <config.h> #include "quirks.h" @@ -44,40 +43,22 @@ #include "analysis/py_line_code.h" #include "analysis/roptions.h" */ -#include "plugin.h" #include "py_log.h" #include "../../src/common/environment.h" +#include "../../src/common/extstr.h" +#include "../../src/plugins/plugin-int.h" -#include "plugin.h" - - - -static GObject *_ref = NULL; - - - -static PyObject *pyoida_get_current_binary(PyObject *self, PyObject *args) -{ - GOpenidaBinary *binary; /* Structure à copier */ - - binary = (GOpenidaBinary *)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 */ }; -static PyObject *__mod; - /****************************************************************************** * * @@ -109,11 +90,6 @@ bool init_plugin(GObject *ref) - printf("Init pyoida\n"); - - _ref = ref; - - /* Définition des zones d'influence */ add_to_env_var("PYTHONPATH", PLUGINS_DIR G_DIR_SEPARATOR_S "python", ";"); @@ -128,13 +104,13 @@ bool init_plugin(GObject *ref) Py_Initialize(); - initpyoida(); + initpychrysa(); /* Chargement des greffons */ - printf("Paths :: '%s'\n", paths); + save = NULL; /* gcc... */ for (path = strtok_r(paths, ";", &save); path != NULL; @@ -147,8 +123,6 @@ bool init_plugin(GObject *ref) continue; } - printf("CHEMIN :: '%s'\n", path); - for (ret = readdir_r(dir, &entry, &next); ret == 0 && next != NULL; ret = readdir_r(dir, &entry, &next)) @@ -159,9 +133,6 @@ bool init_plugin(GObject *ref) filename = stradd(filename, "."); filename = stradd(filename, "__init__"); - printf(" - entry :: '%s'\n", filename); - - plugin = g_python_plugin_new(entry.d_name, filename); if (plugin == NULL) @@ -178,8 +149,6 @@ bool init_plugin(GObject *ref) closedir(dir); - break; /* FIXME */ - } //Py_Finalize(); @@ -207,9 +176,6 @@ PluginAction get_plugin_action(const GPluginModule *plugin) result = PGA_NONE; - - - return result; } @@ -220,46 +186,54 @@ PluginAction get_plugin_action(const GPluginModule *plugin) #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 -}; +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Point d'entrée pour l'initialisation de Python. * +* * +* Retour : ? * +* * +* Remarques : - * +* * +******************************************************************************/ -PyMODINIT_FUNC -PyInit_pyoida(void) +PyMODINIT_FUNC PyInit_pychrysa(void) { - printf("Passage 3\n"); - (void) PyModule_Create(&spammodule); -} + static struct PyModuleDef spammodule = { + PyModuleDef_HEAD_INIT, + "pychrysa", + "pychrysa_doc", + -1, + SpamMethods + }; -#else + PyModule_Create(&spammodule); -/* Python 2.x code */ +} -typedef struct { - PyObject_HEAD - PyObject *md_dict; -} PyModuleObject; +#else +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Point d'entrée pour l'initialisation de Python. * +* * +* Retour : ? * +* * +* Remarques : - * +* * +******************************************************************************/ -PyMODINIT_FUNC -initpyoida(void) +PyMODINIT_FUNC initpychrysa(void) { PyObject *module; pygobject_init(-1, -1, -1); pychrysalide_init_quirks(); - printf("Passage 2\n"); - module = Py_InitModule("pyoida", SpamMethods); - - __mod = module; + module = Py_InitModule("pychrysa", SpamMethods); //add_analysis_roptions_to_python_module(module); add_analysis_module_to_python_module(module); diff --git a/plugins/pyoida/pyoida.h b/plugins/pychrysa/pychrysa.h index 736db8e..e4605e5 100644 --- a/plugins/pyoida/pyoida.h +++ b/plugins/pychrysa/pychrysa.h @@ -1,8 +1,8 @@ /* OpenIDA - Outil d'analyse de fichiers binaires - * pyoida.h - prototypes pour le plugin permettant des extensions en Python + * pychrysa.h - prototypes pour le plugin permettant des extensions en Python * - * Copyright (C) 2009 Cyrille Bagard + * Copyright (C) 2009-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -21,18 +21,38 @@ */ -#ifndef _PLUGINS_PYOIDA_H -#define _PLUGINS_PYOIDA_H +#ifndef _PLUGINS_PYCHRYSA_H +#define _PLUGINS_PYCHRYSA_H +#include <Python.h> #include <glib-object.h> #include <stdbool.h> +#include "plugin.h" + + /* Initialise le greffon permettant l'usage de Python. */ bool init_plugin(GObject *); +/* Indique les opérations offertes par un greffon donné. */ +PluginAction get_plugin_action(const GPluginModule *); + + +#if PY_VERSION_HEX >= 0x03000000 + +/* Point d'entrée pour l'initialisation de Python. */ +PyMODINIT_FUNC PyInit_pychrysa(void); + +#else + +/* Point d'entrée pour l'initialisation de Python. */ +PyMODINIT_FUNC initpychrysa(void); + +#endif + -#endif /* _PLUGINS_PYOIDA_H */ +#endif /* _PLUGINS_PYCHRYSA_H */ diff --git a/plugins/pyoida/quirks.c b/plugins/pychrysa/quirks.c index 4dcae2c..4dcae2c 100644 --- a/plugins/pyoida/quirks.c +++ b/plugins/pychrysa/quirks.c diff --git a/plugins/pyoida/quirks.h b/plugins/pychrysa/quirks.h index 70e036e..70e036e 100644 --- a/plugins/pyoida/quirks.h +++ b/plugins/pychrysa/quirks.h diff --git a/plugins/python/apkfiles/apkfiles.py b/plugins/python/apkfiles/apkfiles.py index fe7deb8..38d0e59 100644 --- a/plugins/python/apkfiles/apkfiles.py +++ b/plugins/python/apkfiles/apkfiles.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from pyoida import Plugin +from pychrysa import Plugin import zipfile |