summaryrefslogtreecommitdiff
path: root/plugins/elf/python/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/elf/python/format.c')
-rw-r--r--plugins/elf/python/format.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/plugins/elf/python/format.c b/plugins/elf/python/format.c
index a5e93d7..f1cf8d6 100644
--- a/plugins/elf/python/format.c
+++ b/plugins/elf/python/format.c
@@ -38,6 +38,9 @@
#include "constants.h"
#include "dynamic.h"
+#include "program.h"
+#include "section.h"
+#include "translate.h"
#include "../format.h"
@@ -45,6 +48,9 @@
/* Crée un nouvel objet Python de type 'ElfFormat'. */
static PyObject *py_elf_format_new(PyTypeObject *, PyObject *, PyObject *);
+/* Fournit l'en-tête Elf correspondant au format. */
+static PyObject *py_elf_format_get_header(PyObject *, PyObject *);
+
/******************************************************************************
@@ -138,6 +144,33 @@ static PyObject *py_elf_format_new(PyTypeObject *type, PyObject *args, PyObject
/******************************************************************************
* *
+* Paramètres : self = contenu binaire à manipuler. *
+* args = argument non utilisé ici. *
+* *
+* Description : Fournit l'en-tête Elf correspondant au format. *
+* *
+* Retour : Structure Python créée pour l'occasion. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static PyObject *py_elf_format_get_header(PyObject *self, PyObject *args)
+{
+ PyObject *result; /* Trouvaille à retourner */
+ GElfFormat *format; /* Version GLib du format */
+
+ format = G_ELF_FORMAT(pygobject_get(self));
+
+ result = translate_elf_header_to_python(format, g_elf_format_get_header(format));
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : - *
* *
* Description : Fournit un accès à une définition de type à diffuser. *
@@ -151,6 +184,41 @@ static PyObject *py_elf_format_new(PyTypeObject *type, PyObject *args, PyObject
PyTypeObject *get_python_elf_format_type(void)
{
static PyMethodDef py_elf_format_methods[] = {
+ {
+ "get_header", py_elf_format_get_header,
+ METH_NOARGS,
+ "get_header($self, /)\n--\n\nGet the Elf header."
+ },
+ {
+ "find_program_by_index", py_elf_format_find_program_by_index,
+ METH_VARARGS,
+ "find_program_by_index($self, index, /)\n--\n\nFind a segment using a given index."
+ },
+ {
+ "find_program_by_type", py_elf_format_find_program_by_type,
+ METH_VARARGS,
+ "find_program_by_type($self, type, /)\n--\n\nFind a segment using a given type."
+ },
+ {
+ "find_section_by_index", py_elf_format_find_section_by_index,
+ METH_VARARGS,
+ "find_section_by_index($self, index, /)\n--\n\nFind a section using a given index."
+ },
+ {
+ "find_section_by_name", py_elf_format_find_section_by_name,
+ METH_VARARGS,
+ "find_section_by_name($self, name, /)\n--\n\nFind a section using a given name."
+ },
+ {
+ "find_section_by_virtual_address", py_elf_format_find_section_by_virtual_address,
+ METH_VARARGS,
+ "find_section_by_virtual_address($self, addr, /)\n--\n\nFind a section using a given virtual address."
+ },
+ {
+ "find_sections_by_type", py_elf_format_find_sections_by_type,
+ METH_VARARGS,
+ "find_sections_by_type($self, type, /)\n--\n\nFind sections using a given type."
+ },
{ NULL }
};