summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-08-18 21:55:24 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-08-18 21:55:24 (GMT)
commita0a7b6c1e05c78ae433f353d15e3366107b67d03 (patch)
treebca0b187778cf016c6131bfc982b08c67a38442b /plugins/pychrysa/arch
parent161c0f8ab227af5033b1b6456607b9b9c3bc60df (diff)
Inserted storages and collections into loaded binaries (first steps).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@389 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/pychrysa/arch')
-rw-r--r--plugins/pychrysa/arch/vmpa.c27
-rw-r--r--plugins/pychrysa/arch/vmpa.h6
2 files changed, 30 insertions, 3 deletions
diff --git a/plugins/pychrysa/arch/vmpa.c b/plugins/pychrysa/arch/vmpa.c
index f9a9db7..43131b5 100644
--- a/plugins/pychrysa/arch/vmpa.c
+++ b/plugins/pychrysa/arch/vmpa.c
@@ -28,7 +28,6 @@
#include <string.h>
-#include <src/arch/vmpa.h>
@@ -544,8 +543,6 @@ PyTypeObject *get_python_vmpa_type(void)
}
-
-
/******************************************************************************
* *
* Paramètres : module = module dont la définition est à compléter. *
@@ -574,3 +571,27 @@ bool register_python_vmpa(PyObject *module)
return (ret == 0);
}
+
+
+/******************************************************************************
+* *
+* Paramètres : obj = objet Python à traiter. *
+* *
+* Description : Donne accès au coeur d'un objet 'pychrysalide.arch.vmpa'. *
+* *
+* Retour : Localistion réelle ou NULL en cas de mauvaise conversion. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+vmpa2t *get_internal_vmpa(PyObject *obj)
+{
+ int ret; /* Bilan d'analyse */
+
+ ret = PyObject_IsInstance(obj, (PyObject *)get_python_vmpa_type());
+ if (!ret) return NULL;
+
+ return &((py_vmpa_t *)obj)->addr;
+
+}
diff --git a/plugins/pychrysa/arch/vmpa.h b/plugins/pychrysa/arch/vmpa.h
index 6ee00b2..8635b51 100644
--- a/plugins/pychrysa/arch/vmpa.h
+++ b/plugins/pychrysa/arch/vmpa.h
@@ -30,6 +30,9 @@
#include <stdbool.h>
+#include <src/arch/vmpa.h>
+
+
/* Fournit un accès à une définition de type à diffuser. */
PyTypeObject *get_python_vmpa_type(void);
@@ -37,6 +40,9 @@ PyTypeObject *get_python_vmpa_type(void);
/* Prend en charge l'objet 'pychrysalide.arch.vmpa'. */
bool register_python_vmpa(PyObject *);
+/* Donne accès au coeur d'un objet 'pychrysalide.arch.vmpa'. */
+vmpa2t *get_internal_vmpa(PyObject *);
+
#endif /* _PLUGINS_PYCHRYSALIDE_ARCH_VMPA_H */