diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-01-09 19:25:41 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-01-09 19:25:41 (GMT) |
commit | 5adcf950f1f928c7127f2d694b52addf54cc04ca (patch) | |
tree | 73cc013056dae1744c13ab6c910755d5a27291a5 | |
parent | 23b50ae8e91c864d5ef800ca97fd23384502b822 (diff) |
Updated the Python API dealing with basic blocks.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/routine.c | 6 | ||||
-rw-r--r-- | src/analysis/disass/block.h | 6 | ||||
-rw-r--r-- | src/analysis/routine.h | 3 |
4 files changed, 17 insertions, 9 deletions
@@ -1,3 +1,14 @@ +18-01-09 Cyrille Bagard <nocbos@gmail.com> + + * plugins/pychrysa/analysis/routine.c: + Update the Python API dealing with basic blocks. + + * src/analysis/disass/block.h: + Typo. + + * src/analysis/routine.h: + Clean code. + 18-01-07 Cyrille Bagard <nocbos@gmail.com> * plugins/elf/helper_arm.c: diff --git a/plugins/pychrysa/analysis/routine.c b/plugins/pychrysa/analysis/routine.c index 1151b96..37f36a7 100644 --- a/plugins/pychrysa/analysis/routine.c +++ b/plugins/pychrysa/analysis/routine.c @@ -169,7 +169,7 @@ static PyObject *py_binary_routine_get_basic_blocks(PyObject *self, void *closur { PyObject *result; /* Eléments à retourner */ GBinRoutine *routine; /* Version native */ - GInstrBlock *blocks; /* Blocs basiques de routine */ + GBlockList *blocks; /* Blocs basiques de routine */ routine = G_BIN_ROUTINE(pygobject_get(self)); blocks = g_binary_routine_get_basic_blocks(routine); @@ -199,13 +199,13 @@ static int py_binary_routine_set_basic_blocks(PyObject *self, PyObject *value, v { GBinRoutine *routine; /* Elément à consulter */ int ret; /* Bilan de lecture des args. */ - GInstrBlock *blocks; /* Blocs basiques à intégrer */ + GBlockList *blocks; /* Blocs basiques à intégrer */ ret = PyObject_IsInstance(value, (PyObject *)get_python_instr_block_type()); if (!ret) return -1; routine = G_BIN_ROUTINE(pygobject_get(self)); - blocks = G_INSTR_BLOCK(pygobject_get(value)); + blocks = G_BLOCK_LIST(pygobject_get(value)); g_binary_routine_set_basic_blocks(routine, blocks); diff --git a/src/analysis/disass/block.h b/src/analysis/disass/block.h index 5168a86..49c6a14 100644 --- a/src/analysis/disass/block.h +++ b/src/analysis/disass/block.h @@ -78,11 +78,11 @@ const bitfield_t *g_basic_block_get_domination(const GBasicBlock *); #define G_TYPE_BLOCK_LIST g_block_list_get_type() -#define G_BLOCK_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_block_list_get_type(), GBasicBlock)) +#define G_BLOCK_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_block_list_get_type(), GBlockList)) #define G_IS_BLOCK_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_block_list_get_type())) -#define G_BLOCK_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_BLOCK_LIST, GBasicBlockClass)) +#define G_BLOCK_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_BLOCK_LIST, GBlockListClass)) #define G_IS_BLOCK_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_BLOCK_LIST)) -#define G_BLOCK_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_BLOCK_LIST, GBasicBlockClass)) +#define G_BLOCK_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_BLOCK_LIST, GBlockListClass)) /* Description d'une liste de blocs basiques (instance) */ diff --git a/src/analysis/routine.h b/src/analysis/routine.h index 48cec13..9e09a6f 100644 --- a/src/analysis/routine.h +++ b/src/analysis/routine.h @@ -34,11 +34,8 @@ #include "variable.h" #include "disass/block.h" #include "../arch/processor.h" -//#include "../arch/instruction.h" -typedef struct _GArchInstruction GArchInstruction; - /* Type de routine traitée */ typedef enum _RoutineType |