From 22e16ebcda77b8b03eae05cee3609c9c7c0e2df2 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Mon, 20 Nov 2017 23:01:18 +0100 Subject: Fixed some types when parsing Python arguments. --- ChangeLog | 9 +++++++++ plugins/pychrysa/analysis/db/items/comment.c | 2 +- plugins/pychrysa/arch/processor.c | 2 +- plugins/pychrysa/debug/debugger.c | 18 +++++++++--------- plugins/pychrysa/format/format.c | 2 +- plugins/pychrysa/glibext/configuration.c | 8 ++++---- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e81f71..949f5de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 17-11-20 Cyrille Bagard + * plugins/pychrysa/analysis/db/items/comment.c: + * plugins/pychrysa/arch/processor.c: + * plugins/pychrysa/debug/debugger.c: + * plugins/pychrysa/format/format.c: + * plugins/pychrysa/glibext/configuration.c: + Fix some types when parsing Python arguments. + +17-11-20 Cyrille Bagard + * src/analysis/project.c: * src/analysis/project.h: * src/gui/menus/file.c: diff --git a/plugins/pychrysa/analysis/db/items/comment.c b/plugins/pychrysa/analysis/db/items/comment.c index 1062cc9..28886f5 100644 --- a/plugins/pychrysa/analysis/db/items/comment.c +++ b/plugins/pychrysa/analysis/db/items/comment.c @@ -68,7 +68,7 @@ static PyObject *py_db_comment_new(PyTypeObject *type, PyObject *args, PyObject { PyObject *result; /* Instance à retourner */ PyObject *py_vmpa; /* Localisation version Python */ - char *text; /* Texte à associer */ + const char *text; /* Texte à associer */ int is_volatile; /* Conservation en mémoire */ int ret; /* Bilan de lecture des args. */ vmpa2t *addr; /* Localisation version C */ diff --git a/plugins/pychrysa/arch/processor.c b/plugins/pychrysa/arch/processor.c index 4470e78..65431af 100644 --- a/plugins/pychrysa/arch/processor.c +++ b/plugins/pychrysa/arch/processor.c @@ -109,7 +109,7 @@ static PyObject *py_arch_processor_add_error(PyObject *self, PyObject *args) { ArchProcessingError type; /* Type d'erreur détectée */ vmpa2t addr; /* Position d'une erreur */ - char *desc; /* Description d'une erreur */ + const char *desc; /* Description d'une erreur */ int ret; /* Bilan de lecture des args. */ GArchProcessor *proc; /* Processeur manipulé */ diff --git a/plugins/pychrysa/debug/debugger.c b/plugins/pychrysa/debug/debugger.c index 6f930a4..20b94c7 100644 --- a/plugins/pychrysa/debug/debugger.c +++ b/plugins/pychrysa/debug/debugger.c @@ -417,7 +417,7 @@ static PyObject *py_binary_debugger_get_register_size(PyObject *self, PyObject * { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ unsigned int size; /* Taille associée au registre */ @@ -453,7 +453,7 @@ static PyObject *py_binary_debugger_read_register_u8(PyObject *self, PyObject *a { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ uint8_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -497,7 +497,7 @@ static PyObject *py_binary_debugger_read_register_u16(PyObject *self, PyObject * { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ uint16_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -541,7 +541,7 @@ static PyObject *py_binary_debugger_read_register_u32(PyObject *self, PyObject * { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ uint32_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -585,7 +585,7 @@ static PyObject *py_binary_debugger_read_register_u64(PyObject *self, PyObject * { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ uint64_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -629,7 +629,7 @@ static PyObject *py_binary_debugger_write_register_u8(PyObject *self, PyObject * { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ uint8_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -667,7 +667,7 @@ static PyObject *py_binary_debugger_write_register_u16(PyObject *self, PyObject { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ uint16_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -705,7 +705,7 @@ static PyObject *py_binary_debugger_write_register_u32(PyObject *self, PyObject { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ uint32_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -743,7 +743,7 @@ static PyObject *py_binary_debugger_write_register_u64(PyObject *self, PyObject { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - char *reg; /* Nom du registre à manipuler */ + const char *reg; /* Nom du registre à manipuler */ int ret; /* Bilan de lecture des args. */ uint64_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ diff --git a/plugins/pychrysa/format/format.c b/plugins/pychrysa/format/format.c index 41dab9d..aed9664 100644 --- a/plugins/pychrysa/format/format.c +++ b/plugins/pychrysa/format/format.c @@ -580,7 +580,7 @@ static PyObject *py_binary_format_add_error(PyObject *self, PyObject *args) { BinaryFormatError type; /* Type d'erreur détectée */ vmpa2t addr; /* Position d'une erreur */ - char *desc; /* Description d'une erreur */ + const char *desc; /* Description d'une erreur */ int ret; /* Bilan de lecture des args. */ GBinFormat *format; /* Format binaire manipulé */ diff --git a/plugins/pychrysa/glibext/configuration.c b/plugins/pychrysa/glibext/configuration.c index 3ced957..a780f73 100644 --- a/plugins/pychrysa/glibext/configuration.c +++ b/plugins/pychrysa/glibext/configuration.c @@ -142,7 +142,7 @@ static PyObject *py_generic_config_get_filename(PyObject *, void *); static PyObject *py_config_param_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *result; /* Instance à retourner */ - char *path; /* Accès au paramètre */ + const char *path; /* Accès au paramètre */ unsigned int ptype; /* Type de paramètre */ PyObject *value; /* Valeur par défaut éventuelle*/ int ret; /* Bilan de lecture des args. */ @@ -814,7 +814,7 @@ bool register_python_config_param_iterator(PyObject *module) static PyObject *py_generic_config_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *result; /* Instance à retourner */ - char *name; /* Nom du fichier à charger */ + const char *name; /* Nom du fichier à charger */ int ret; /* Bilan de lecture des args. */ GGenConfig *config; /* Version GLib du format */ @@ -910,7 +910,7 @@ static PyObject *py_generic_config_search(PyObject *self, PyObject *args) { PyObject *result; /* Instance à retourner */ GGenConfig *config; /* Version GLib du format */ - char *path; /* Chemin d'accès du paramètre */ + const char *path; /* Chemin d'accès du paramètre */ int ret; /* Bilan de lecture des args. */ GCfgParam *param; /* Paramètre trouvé ou NULL */ @@ -989,7 +989,7 @@ static PyObject *py_generic_config_add(PyObject *self, PyObject *args) static PyObject *py_generic_config_delete(PyObject *self, PyObject *args) { GGenConfig *config; /* Version GLib du format */ - char *path; /* Chemin d'accès du paramètre */ + const char *path; /* Chemin d'accès du paramètre */ int ret; /* Bilan de lecture des args. */ config = G_GEN_CONFIG(pygobject_get(self)); -- cgit v0.11.2-87-g4458