diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2019-09-29 15:34:53 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2019-09-29 15:34:53 (GMT) | 
| commit | 2de826110c85feb68d6e5b09c133e2300ae4c0d0 (patch) | |
| tree | b3fad748a8e71e9b7f6b52fccc5dcaab36590f6b | |
| parent | 522298cf50e67d92b0aa85a85177ed7c16b00e08 (diff) | |
Fixed the access to connected clients from the Python API.
| -rw-r--r-- | plugins/pychrysalide/analysis/binary.c | 4 | ||||
| -rw-r--r-- | src/analysis/binary.c | 5 | 
2 files changed, 7 insertions, 2 deletions
| diff --git a/plugins/pychrysalide/analysis/binary.c b/plugins/pychrysalide/analysis/binary.c index e97bea6..eb71a62 100644 --- a/plugins/pychrysalide/analysis/binary.c +++ b/plugins/pychrysalide/analysis/binary.c @@ -127,7 +127,7 @@ static PyObject *py_loaded_binary_new(PyTypeObject *type, PyObject *args, PyObje  static PyObject *py_loaded_binary_get_client(PyObject *self, PyObject *args)  {      PyObject *result;                       /* Bilan à retourner           */ -    bool internal;                          /* Nature du client visé       */ +    int internal;                           /* Nature du client visé       */      int ret;                                /* Bilan de lecture des args.  */      GLoadedBinary *binary;                  /* Binaire en cours d'analyse  */      GHubClient *client;                     /* Eventuel client en place    */ @@ -140,6 +140,8 @@ static PyObject *py_loaded_binary_get_client(PyObject *self, PyObject *args)      " if defined, or return None otherwise.\n"                          \  ) +    internal = 1; +      ret = PyArg_ParseTuple(args, "|p", &internal);      if (!ret) return NULL; diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 05e42c7..fb715bb 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -973,7 +973,10 @@ GHubClient *g_loaded_binary_get_client(const GLoadedBinary *binary, bool interna  {      GHubClient *result;                     /* Instance à retourner        */ -    result = binary->local; +    if (internal) +        result = binary->local; +    else +        result = binary->remote;      if (result != NULL)          g_object_ref(G_OBJECT(result)); | 
