summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/plugin.c
diff options
context:
space:
mode:
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;