summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2021-10-24 22:13:40 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2021-10-24 22:15:59 (GMT)
commit55faf115708f8448c1dbbb1798ac115e8021e45f (patch)
tree995059fb5d651b29ebc457c7c11396eba53867ec /plugins
parentda03e81474f8e5271c61cb88cb56bb1f9e2b3cfd (diff)
Use the loaded content class hints in the DB archives.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pychrysalide/analysis/db/analyst.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/pychrysalide/analysis/db/analyst.c b/plugins/pychrysalide/analysis/db/analyst.c
index bb9af30..289db31 100644
--- a/plugins/pychrysalide/analysis/db/analyst.c
+++ b/plugins/pychrysalide/analysis/db/analyst.c
@@ -37,6 +37,7 @@
#include "client.h"
#include "collection.h"
#include "../content.h"
+#include "../loaded.h"
#include "../../access.h"
#include "../../helpers.h"
#include "../../struct.h"
@@ -95,7 +96,9 @@ static PyObject *py_analyst_client_get_current_snapshot(PyObject *, void *);
static PyObject *py_analyst_client_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyObject *result; /* Instance à retourner */
+ GLoadedContent *loaded; /* Contenu local déjà chargé */
const char *hash; /* Empreinte du binaire visé */
+ const char *class; /* Nature du contenu analysé */
PyObject *list; /* Liste Python de collections */
int ret; /* Bilan de lecture des args. */
Py_ssize_t length; /* Nombre d'éléments collectés */
@@ -113,11 +116,15 @@ static PyObject *py_analyst_client_new(PyTypeObject *type, PyObject *args, PyObj
"\n" \
"Instances can be created using the following constructor:\n" \
"\n" \
- " AnalystClient(hash, list)" \
+ " AnalystClient(hash, class, list, loaded=None)" \
"\n" \
- "Where hash is a SHA256 fingerprint of the studied binary and list is a list of" \
+ "Where *hash* is a SHA256 fingerprint of the studied binary, *class* refers to" \
+ " the nature description of the loaded content (as provided from" \
+ " pychrysalide.analysis.LoadedContent.content_class), *list* is a list of" \
" pychrysalide.analysis.db.DbCollection instances ; this kind of list can be" \
" retrived with the pychrysalide.analysis.LoadedBinary.collections attribute." \
+ " The *loaded* object is an optional local already loaded content which has to" \
+ " be a pychrysalide.analysis.LoadedContent instance or *None*." \
"\n" \
"AnalystClient instances emit the following signals:\n" \
"* 'snapshots-updated'\n" \
@@ -131,7 +138,9 @@ static PyObject *py_analyst_client_new(PyTypeObject *type, PyObject *args, PyObj
" Handlers are expected to have only one argument: the client managing the" \
" snapshots."
- ret = PyArg_ParseTuple(args, "sO", &hash, &list);
+ loaded = NULL;
+
+ ret = PyArg_ParseTuple(args, "ssO|O&", &hash, &class, &list, convert_to_loaded_content, &loaded);
if (!ret) return NULL;
if (!PySequence_Check(list))
@@ -164,7 +173,7 @@ static PyObject *py_analyst_client_new(PyTypeObject *type, PyObject *args, PyObj
}
- client = g_analyst_client_new(hash, collections);
+ client = g_analyst_client_new(hash, class, collections, loaded);
if (client != NULL)
{