summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/format/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/format/format.c')
-rw-r--r--plugins/pychrysalide/format/format.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/pychrysalide/format/format.c b/plugins/pychrysalide/format/format.c
index 2affeba..e285116 100644
--- a/plugins/pychrysalide/format/format.c
+++ b/plugins/pychrysalide/format/format.c
@@ -43,6 +43,8 @@
/* ---------------------------- FORMAT BINAIRE GENERIQUE ---------------------------- */
+/* Enregistre une adresse comme début d'une zone de code. */
+static PyObject *py_binary_format_register_code_point(PyObject *, PyObject *);
/* Ajoute un symbole à la collection du format binaire. */
static PyObject *py_binary_format_add_symbol(PyObject *, PyObject *);
@@ -100,7 +102,36 @@ static bool define_python_binary_format_constants(PyTypeObject *);
/* ---------------------------------------------------------------------------------- */
+/******************************************************************************
+* *
+* Paramètres : self = classe représentant un format. *
+* args = arguments fournis à l'appel. *
+* *
+* Description : Enregistre une adresse comme début d'une zone de code. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static PyObject *py_binary_format_register_code_point(PyObject *self, PyObject *args)
+{
+ unsigned long long pt; /* Adresse virtuelle du point */
+ int entry; /* Nature du point fourni */
+ int ret; /* Bilan de lecture des args. */
+ GBinFormat *format; /* Format de binaire manipulé */
+ ret = PyArg_ParseTuple(args, "Kp", &pt, &entry);
+ if (!ret) return NULL;
+
+ format = G_BIN_FORMAT(pygobject_get(self));
+
+ g_binary_format_register_code_point(format, pt, entry);
+
+ Py_RETURN_NONE;
+
+}
/******************************************************************************
@@ -638,6 +669,11 @@ PyTypeObject *get_python_binary_format_type(void)
{
static PyMethodDef py_bin_format_methods[] = {
{
+ "register_code_point", py_binary_format_register_code_point,
+ METH_VARARGS,
+ "register_code_point($self, pt, entry, /)\n--\n\nRegister a virtual address as entry point or basic point."
+ },
+ {
"add_symbol", py_binary_format_add_symbol,
METH_VARARGS,
"add_symbol($self, symbol, /)\n--\n\nRegister a new symbol for the format."