summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis/contents
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2021-07-04 17:06:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2021-07-04 17:06:28 (GMT)
commit5958d9b25f806df73cd0634de2c9475eb6497e8c (patch)
tree7594605f9722cf5329c965cd35e11d52f2dfc4c8 /plugins/pychrysalide/analysis/contents
parent0150df2a3dafcce46bc95a2cb8642d0bb842ca8d (diff)
Store and load binary contents on demand.
Diffstat (limited to 'plugins/pychrysalide/analysis/contents')
-rw-r--r--plugins/pychrysalide/analysis/contents/encapsulated.c4
-rw-r--r--plugins/pychrysalide/analysis/contents/file.c10
-rw-r--r--plugins/pychrysalide/analysis/contents/memory.c4
-rw-r--r--plugins/pychrysalide/analysis/contents/restricted.c4
4 files changed, 21 insertions, 1 deletions
diff --git a/plugins/pychrysalide/analysis/contents/encapsulated.c b/plugins/pychrysalide/analysis/contents/encapsulated.c
index ef26caa..03fce54 100644
--- a/plugins/pychrysalide/analysis/contents/encapsulated.c
+++ b/plugins/pychrysalide/analysis/contents/encapsulated.c
@@ -32,6 +32,7 @@
#include "../content.h"
+#include "../storage/serialize.h"
#include "../../access.h"
#include "../../helpers.h"
@@ -310,6 +311,9 @@ bool ensure_python_encaps_content_is_registered(void)
dict = PyModule_GetDict(module);
+ if (!ensure_python_serializable_object_is_registered())
+ return false;
+
if (!register_class_for_pygobject(dict, G_TYPE_ENCAPS_CONTENT, type, &PyGObject_Type))
return false;
diff --git a/plugins/pychrysalide/analysis/contents/file.c b/plugins/pychrysalide/analysis/contents/file.c
index 93a1ce8..4786cdb 100644
--- a/plugins/pychrysalide/analysis/contents/file.c
+++ b/plugins/pychrysalide/analysis/contents/file.c
@@ -31,6 +31,8 @@
#include <analysis/contents/file.h>
+#include "memory.h"
+#include "../storage/serialize.h"
#include "../../access.h"
#include "../../helpers.h"
@@ -196,7 +198,13 @@ bool ensure_python_file_content_is_registered(void)
dict = PyModule_GetDict(module);
- if (!register_class_for_pygobject(dict, G_TYPE_FILE_CONTENT, type, &PyGObject_Type))
+ if (!ensure_python_memory_content_is_registered())
+ return false;
+
+ if (!ensure_python_serializable_object_is_registered())
+ return false;
+
+ if (!register_class_for_pygobject(dict, G_TYPE_FILE_CONTENT, type, get_python_memory_content_type()))
return false;
}
diff --git a/plugins/pychrysalide/analysis/contents/memory.c b/plugins/pychrysalide/analysis/contents/memory.c
index 8926300..37b098d 100644
--- a/plugins/pychrysalide/analysis/contents/memory.c
+++ b/plugins/pychrysalide/analysis/contents/memory.c
@@ -31,6 +31,7 @@
#include <analysis/contents/memory.h>
+#include "../storage/serialize.h"
#include "../../access.h"
#include "../../helpers.h"
@@ -164,6 +165,9 @@ bool ensure_python_memory_content_is_registered(void)
dict = PyModule_GetDict(module);
+ if (!ensure_python_serializable_object_is_registered())
+ return false;
+
if (!register_class_for_pygobject(dict, G_TYPE_MEMORY_CONTENT, type, &PyGObject_Type))
return false;
diff --git a/plugins/pychrysalide/analysis/contents/restricted.c b/plugins/pychrysalide/analysis/contents/restricted.c
index bbe364a..703f79b 100644
--- a/plugins/pychrysalide/analysis/contents/restricted.c
+++ b/plugins/pychrysalide/analysis/contents/restricted.c
@@ -35,6 +35,7 @@
#include "../content.h"
+#include "../storage/serialize.h"
#include "../../access.h"
#include "../../helpers.h"
#include "../../arch/vmpa.h"
@@ -200,6 +201,9 @@ bool ensure_python_restricted_content_is_registered(void)
dict = PyModule_GetDict(module);
+ if (!ensure_python_serializable_object_is_registered())
+ return false;
+
if (!register_class_for_pygobject(dict, G_TYPE_RESTRICTED_CONTENT, type, &PyGObject_Type))
return false;