summaryrefslogtreecommitdiff
path: root/plugins/pe/python/routine.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pe/python/routine.c')
-rw-r--r--plugins/pe/python/routine.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/plugins/pe/python/routine.c b/plugins/pe/python/routine.c
index 89075ea..cebeb2a 100644
--- a/plugins/pe/python/routine.c
+++ b/plugins/pe/python/routine.c
@@ -62,6 +62,9 @@ static int py_pe_exported_routine_set_ordinal(PyObject *, PyObject *, void *);
" imported from other PE file symbol."
+/* Fournit la position du symbole dans les importations. */
+static PyObject *py_pe_imported_routine_get_index(PyObject *, void *);
+
/* Fournit le fichier DLL visé par une importation de format PE. */
static PyObject *py_pe_imported_routine_get_library(PyObject *, void *);
@@ -285,6 +288,44 @@ int convert_to_pe_exported_routine(PyObject *arg, void *dst)
* Paramètres : self = objet Python concerné par l'appel. *
* closure = non utilisé ici. *
* *
+* Description : Fournit la position du symbole dans les importations. *
+* *
+* Retour : Indice positif ou nul. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static PyObject *py_pe_imported_routine_get_index(PyObject *self, void *closure)
+{
+ PyObject *result; /* Valeur à retourner */
+ GPeImportedRoutine *routine; /* Version native */
+ size_t index; /* Position dans les imports */
+
+#define PE_IMPORTED_ROUTINE_INDEX_ATTRIB PYTHON_GET_DEF_FULL \
+( \
+ index, py_pe_imported_routine, \
+ "Position of the symbol inside the importations table.\n" \
+ "\n" \
+ "The returned value is an integer." \
+)
+
+ routine = G_PE_IMPORTED_ROUTINE(pygobject_get(self));
+
+ index = g_pe_imported_routine_get_index(routine);
+
+ result = PyLong_FromSize_t(index);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : self = objet Python concerné par l'appel. *
+* closure = non utilisé ici. *
+* *
* Description : Fournit le fichier DLL visé par une importation de format PE.*
* *
* Retour : Désignation d'une bibliothèque Windows. *
@@ -299,7 +340,7 @@ static PyObject *py_pe_imported_routine_get_library(PyObject *self, void *closur
GPeImportedRoutine *routine; /* Version native */
const char *library; /* Nom de bibliothèque */
-#define PE_IMPORTED_ROUTINE_ORDINAL_ATTRIB PYTHON_GETSET_DEF_FULL \
+#define PE_IMPORTED_ROUTINE_LIBRARY_ATTRIB PYTHON_GETSET_DEF_FULL \
( \
library, py_pe_imported_routine, \
"Imported DLL's name for the symbol.\n" \
@@ -373,7 +414,8 @@ PyTypeObject *get_python_pe_imported_routine_type(void)
};
static PyGetSetDef py_pe_imported_routine_getseters[] = {
- PE_IMPORTED_ROUTINE_ORDINAL_ATTRIB,
+ PE_IMPORTED_ROUTINE_INDEX_ATTRIB,
+ PE_IMPORTED_ROUTINE_LIBRARY_ATTRIB,
{ NULL }
};