summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/plugin.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-01-26 19:41:04 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-01-26 19:41:04 (GMT)
commit2050b07c42c15738662dd9b3c5841694b64ab2a3 (patch)
treef6283df4b4775f0c4e42e14025d67443f8fdf9b5 /plugins/pychrysa/plugin.c
parentb0b35292cb22899b1b23556be452eb827e4010d7 (diff)
Provided some debug helpers as plugin samples.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@330 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/pychrysa/plugin.c')
-rw-r--r--plugins/pychrysa/plugin.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/plugins/pychrysa/plugin.c b/plugins/pychrysa/plugin.c
index c562044..e2ba78b 100644
--- a/plugins/pychrysa/plugin.c
+++ b/plugins/pychrysa/plugin.c
@@ -392,8 +392,13 @@ static PluginAction g_python_plugin_get_action(const GPythonPlugin *plugin)
value = run_python_method(plugin->instance, "get_action", NULL);
- result = PyLong_AsLong(value);
- Py_DECREF(value);
+ if (value != NULL)
+ {
+ result = PyLong_AsLong(value);
+ Py_DECREF(value);
+ }
+ else
+ result = PGA_NONE;
return result;
@@ -651,6 +656,21 @@ static bool pychrysa_plugin_define_constants(PyObject *dict)
ret = PyDict_SetItemString(dict, "PGA_DISASSEMBLE", PyInt_FromLong(PGA_DISASSEMBLE));
if (ret == -1) return false;
+ ret = PyDict_SetItemString(dict, "PGA_BINARY_DISASSEMBLED", PyInt_FromLong(PGA_BINARY_DISASSEMBLED));
+ if (ret == -1) return false;
+
+ ret = PyDict_SetItemString(dict, "PGA_BINARY_LINKED", PyInt_FromLong(PGA_BINARY_LINKED));
+ if (ret == -1) return false;
+
+ ret = PyDict_SetItemString(dict, "PGA_BINARY_BOUNDED", PyInt_FromLong(PGA_BINARY_BOUNDED));
+ if (ret == -1) return false;
+
+ ret = PyDict_SetItemString(dict, "PGA_BINARY_GROUPED", PyInt_FromLong(PGA_BINARY_GROUPED));
+ if (ret == -1) return false;
+
+ ret = PyDict_SetItemString(dict, "PGA_BINARY_PRINTED", PyInt_FromLong(PGA_BINARY_PRINTED));
+ if (ret == -1) return false;
+
ret = PyDict_SetItemString(dict, "PGA_DISASS_PROCESS", PyInt_FromLong(PGA_DISASS_PROCESS));
if (ret == -1) return false;