diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/pychrysa/format/format.c | 39 | 
1 files changed, 39 insertions, 0 deletions
| diff --git a/plugins/pychrysa/format/format.c b/plugins/pychrysa/format/format.c index 1b129d0..42aed5c 100644 --- a/plugins/pychrysa/format/format.c +++ b/plugins/pychrysa/format/format.c @@ -76,6 +76,9 @@ static PyObject *py_binary_format_find_next_symbol_at(PyObject *, PyObject *);  /* Recherche le symbole correspondant à une adresse. */  static PyObject *py_binary_format_resolve_symbol(PyObject *, PyObject *); +/* Fournit une référence vers le contenu binaire analysé. */ +static PyObject *py_binary_format_get_content(PyObject *, void *); +  /* Fournit la liste de tous les symboles détectés. */  static PyObject *py_binary_format_get_symbols(PyObject *, void *); @@ -463,6 +466,38 @@ static PyObject *py_binary_format_resolve_symbol(PyObject *self, PyObject *args)  /******************************************************************************  *                                                                             * +*  Paramètres  : self    = objet Python concerné par l'appel.                 * +*                closure = non utilisé ici.                                   * +*                                                                             * +*  Description : Fournit une référence vers le contenu binaire analysé.       * +*                                                                             * +*  Retour      : Gestionnaire de contenu binaire en place.                    * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +static PyObject *py_binary_format_get_content(PyObject *self, void *closure) +{ +    PyObject *result;                       /* Trouvailles à retourner     */ +    GBinFormat *format;                     /* Format de binaire manipulé  */ +    GBinContent *content;                   /* Instance GLib correspondante*/ + +    format = G_BIN_FORMAT(pygobject_get(self)); + +    content = g_binary_format_get_content(format); + +    result = pygobject_new(G_OBJECT(content)); + +    g_object_unref(content); + +    return result; + +} + + +/****************************************************************************** +*                                                                             *  *  Paramètres  : self    = classe représentant un format binaire.             *  *                closure = adresse non utilisée ici.                          *  *                                                                             * @@ -534,6 +569,10 @@ PyTypeObject *get_python_binary_format_type(void)      static PyGetSetDef py_bin_format_getseters[] = {          { +            "content", py_binary_format_get_content, NULL, +            "Content of the binary format.", NULL +        }, +        {              "symbols", py_binary_format_get_symbols, NULL,              "Iterable list of all symbols found in the binary format.", NULL          }, | 
