summaryrefslogtreecommitdiff
path: root/plugins/fmtp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/fmtp')
-rw-r--r--plugins/fmtp/parser.c26
-rw-r--r--plugins/fmtp/parser.h3
2 files changed, 11 insertions, 18 deletions
diff --git a/plugins/fmtp/parser.c b/plugins/fmtp/parser.c
index 8fc693f..ea1e5d8 100644
--- a/plugins/fmtp/parser.c
+++ b/plugins/fmtp/parser.c
@@ -33,7 +33,7 @@
/* Effectue l'interprétation d'une définition de champ. */
-static bool parse_field_definition(const fmt_field_def *, GBinFormat *, vmpa2t *, void *);
+static bool parse_field_definition(const fmt_field_def *, GBinFormat *, GPreloadInfo *, vmpa2t *, void *);
@@ -41,6 +41,7 @@ static bool parse_field_definition(const fmt_field_def *, GBinFormat *, vmpa2t *
* *
* Paramètres : def = définition de champ à considérer. *
* format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* pos = tête de lecture pour les données. *
* data = infos complémentaires éventuellement fournies. *
* *
@@ -52,7 +53,7 @@ static bool parse_field_definition(const fmt_field_def *, GBinFormat *, vmpa2t *
* *
******************************************************************************/
-static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format, vmpa2t *pos, void *data)
+static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format, GPreloadInfo *info, vmpa2t *pos, void *data)
{
GBinContent *content; /* Contenu binaire à lire */
SourceEndian endian; /* Boutisme utilisé */
@@ -66,10 +67,6 @@ static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format,
uint64_t raw; /* Valeur brute à étudier */
const comment_part *part; /* Accès plus direct */
-
- GBinSymbol *symbol; /* Symbole à intégrer */
-
-
/* Lecture */
content = g_binary_format_get_content(format);
@@ -193,17 +190,11 @@ static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format,
}
- /* Insertion */
+ /* Insertions */
- symbol = g_binary_symbol_new(STP_DATA);
+ g_preload_info_add_instruction(info, instr);
- g_binary_symbol_attach_instruction(symbol, instr);
- g_binary_symbol_set_comment(symbol, comment);
-
- result = g_binary_format_add_symbol(format, symbol);
-
- if (!result)
- g_object_unref(G_OBJECT(instr));
+ g_preload_info_add_comment(info, comment);
pfd_exit:
@@ -219,6 +210,7 @@ static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format,
* Paramètres : defs = liste de définitions à traiter. *
* count = taille de cette liste. *
* format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* pos = tête de lecture pour les données. *
* data = infos complémentaires éventuellement fournies. *
* *
@@ -230,7 +222,7 @@ static bool parse_field_definition(const fmt_field_def *def, GBinFormat *format,
* *
******************************************************************************/
-bool parse_field_definitions(const fmt_field_def *defs, size_t count, GBinFormat *format, vmpa2t *pos, void *data)
+bool parse_field_definitions(const fmt_field_def *defs, size_t count, GBinFormat *format, GPreloadInfo *info, vmpa2t *pos, void *data)
{
bool result; /* Bilan à retourner */
size_t i; /* Boucle de parcours */
@@ -238,7 +230,7 @@ bool parse_field_definitions(const fmt_field_def *defs, size_t count, GBinFormat
result = true;
for (i = 0; i < count && result; i++)
- result = parse_field_definition(defs + i, format, pos, data);
+ result = parse_field_definition(defs + i, format, info, pos, data);
return result;
diff --git a/plugins/fmtp/parser.h b/plugins/fmtp/parser.h
index 0d5dff3..310ff37 100644
--- a/plugins/fmtp/parser.h
+++ b/plugins/fmtp/parser.h
@@ -29,6 +29,7 @@
#include <format/format.h>
+#include <format/preload.h>
#include "def.h"
@@ -36,7 +37,7 @@
/* Lance l'interprétation d'une série de définitions de champs. */
-bool parse_field_definitions(const fmt_field_def *, size_t, GBinFormat *, vmpa2t *, void *);
+bool parse_field_definitions(const fmt_field_def *, size_t, GBinFormat *, GPreloadInfo *, vmpa2t *, void *);