summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/format/dex/dex.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/format/dex/dex.c')
-rw-r--r--plugins/pychrysa/format/dex/dex.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/pychrysa/format/dex/dex.c b/plugins/pychrysa/format/dex/dex.c
index cae87f7..3e2746e 100644
--- a/plugins/pychrysa/format/dex/dex.c
+++ b/plugins/pychrysa/format/dex/dex.c
@@ -168,7 +168,7 @@ static PyObject *py_dex_format_get_class(PyObject *self, PyObject *args)
bool register_python_dex_format(PyObject *module)
{
- PyObject *pygobj_mod; /* Module Python-GObject */
+ PyObject *parent_mod; /* Accès au module parent */
int ret; /* Bilan d'un appel */
static PyMethodDef py_dex_format_methods[] = {
@@ -206,11 +206,11 @@ bool register_python_dex_format(PyObject *module)
};
- pygobj_mod = PyImport_ImportModule("pychrysalide.format");
- if (pygobj_mod == NULL) return false;
+ parent_mod = PyImport_ImportModule("pychrysalide.format");
+ if (parent_mod == NULL) return false;
- py_dex_format_type.tp_base = (PyTypeObject *)PyObject_GetAttrString(pygobj_mod, "BinFormat");
- Py_DECREF(pygobj_mod);
+ py_dex_format_type.tp_base = (PyTypeObject *)PyObject_GetAttrString(parent_mod, "ExeFormat");
+ Py_DECREF(parent_mod);
if (PyType_Ready(&py_dex_format_type) < 0)
return false;
@@ -218,8 +218,14 @@ bool register_python_dex_format(PyObject *module)
Py_INCREF(&py_dex_format_type);
ret = PyModule_AddObject(module, "DexFormat", (PyObject *)&py_dex_format_type);
+ parent_mod = PyImport_ImportModule("pychrysalide.format");
+ if (parent_mod == NULL) return false;
+
pygobject_register_class(module, "GDexFormat", G_TYPE_DEX_FORMAT, &py_dex_format_type,
- Py_BuildValue("(O)", py_dex_format_type.tp_base));
+ Py_BuildValue("(OO)", py_dex_format_type.tp_base,
+ PyObject_GetAttrString(parent_mod, "BinFormat")));
+
+ Py_DECREF(parent_mod);
return (ret == 0);