diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-06-17 16:11:45 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-06-17 16:11:45 (GMT) |
commit | 378be1ab322dce8e8377d692829d6877758e5960 (patch) | |
tree | 17dc518687a45649caa68304cc2a5750a0a50554 /src | |
parent | 1f7e9506775f66a3a5f2859779d33b914eee8ef4 (diff) |
Annotated linux kernel syscalls using a new plugin.
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/instriter.c | 35 | ||||
-rw-r--r-- | src/arch/instriter.h | 3 | ||||
-rw-r--r-- | src/core/paths.c | 4 |
3 files changed, 40 insertions, 2 deletions
diff --git a/src/arch/instriter.c b/src/arch/instriter.c index db322a2..d968ba8 100644 --- a/src/arch/instriter.c +++ b/src/arch/instriter.c @@ -81,6 +81,41 @@ instr_iter_t *create_instruction_iterator(GArchProcessor *proc, size_t index) /****************************************************************************** * * +* Paramètres : iter = itérateur à copie. * +* * +* Description : Duplique un itérateur de parcours d'instructions existant. * +* * +* Retour : Itérateur prêt à emploi. * +* * +* Remarques : - * +* * +******************************************************************************/ + +instr_iter_t *copy_instruction_iterator(const instr_iter_t *iter) +{ + instr_iter_t *result; /* Structure à retourner */ + + result = (instr_iter_t *)malloc(sizeof(instr_iter_t)); + + g_object_ref(G_OBJECT(iter->proc)); + + result->proc = iter->proc; + result->stamp = iter->stamp; + + result->index = iter->index; + + result->is_restricted = iter->is_restricted; + + if (result->is_restricted) + copy_mrange(&result->restriction, &iter->restriction); + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : iter = itérateur à traiter. * * * * Description : Détruit un itérateur mis en place. * diff --git a/src/arch/instriter.h b/src/arch/instriter.h index 1a0003f..68db9cb 100644 --- a/src/arch/instriter.h +++ b/src/arch/instriter.h @@ -39,6 +39,9 @@ typedef struct _instr_iter_t instr_iter_t; /* Construit un itérateur pour parcourir des instructions. */ instr_iter_t *create_instruction_iterator(GArchProcessor *, size_t); +/* Duplique un itérateur de parcours d'instructions existant. */ +instr_iter_t *copy_instruction_iterator(const instr_iter_t *); + /* Détruit un itérateur mis en place. */ void delete_instruction_iterator(instr_iter_t *); diff --git a/src/core/paths.c b/src/core/paths.c index 13b9cbe..8e825d2 100644 --- a/src/core/paths.c +++ b/src/core/paths.c @@ -136,8 +136,8 @@ char *find_plugin_file(const char *pgname, const char *filename) #ifndef DISCARD_LOCAL - asprintf(&dirname, "%s%splugins%s%s%s%s", - PACKAGE_SOURCE_DIR, G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S, pgname, G_DIR_SEPARATOR_S, filename); + asprintf(&dirname, "%s%splugins%s%s", + PACKAGE_SOURCE_DIR, G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S, pgname); result = find_file_in_directory(dirname, filename); |