summaryrefslogtreecommitdiff
path: root/src/analysis/content-int.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-09-11 20:40:24 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-09-11 20:40:24 (GMT)
commit18648e4e8763a3bc005d6fae51eae3d1528d7d29 (patch)
tree05feca5b6c5575b2a048b60130e3207b9f2c355a /src/analysis/content-int.h
parent9f8c79e3b272960b48bfd85a24f4b5cb5651df2d (diff)
Created an interface from the original GBinContent object.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@576 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/content-int.h')
-rw-r--r--src/analysis/content-int.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/analysis/content-int.h b/src/analysis/content-int.h
new file mode 100644
index 0000000..7734916
--- /dev/null
+++ b/src/analysis/content-int.h
@@ -0,0 +1,86 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * content-int.h - définitions internes propres aux contenus binaires
+ *
+ * Copyright (C) 2015 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _ANALYSIS_CONTENT_INT_H
+#define _ANALYSIS_CONTENT_INT_H
+
+
+#include "content.h"
+
+
+
+/* Fournit une empreinte unique (SHA256) pour les données. */
+typedef const gchar * (* get_checksum_fc) (GBinContent *);
+
+/* Détermine le nombre d'octets lisibles. */
+typedef phys_t (* compute_size_fc) (const GBinContent *);
+
+/* Donne accès à une portion des données représentées. */
+typedef const bin_t * (* get_raw_access_fc) (const GBinContent *, vmpa2t *, phys_t);
+
+/* Fournit une portion des données représentées. */
+typedef bool (* read_raw_fc) (const GBinContent *, vmpa2t *, phys_t, bin_t *);
+
+/* Lit un nombre non signé sur quatre bits. */
+typedef bool (* read_u4_fc) (const GBinContent *, vmpa2t *, bool *, uint8_t *);
+
+/* Lit un nombre non signé sur un octet. */
+typedef bool (* read_u8_fc) (const GBinContent *, vmpa2t *, uint8_t *);
+
+/* Lit un nombre non signé sur deux octets. */
+typedef bool (* read_u16_fc) (const GBinContent *, vmpa2t *, SourceEndian, uint16_t *);
+
+/* Lit un nombre non signé sur quatre octets. */
+typedef bool (* read_u32_fc) (const GBinContent *, vmpa2t *, SourceEndian, uint32_t *);
+
+/* Lit un nombre non signé sur huit octets. */
+typedef bool (* read_u64_fc) (const GBinContent *, vmpa2t *, SourceEndian, uint64_t *);
+
+
+/* Accès à un contenu binaire quelconque (interface) */
+struct _GBinContentIface
+{
+ GTypeInterface base_iface; /* A laisser en premier */
+
+ get_checksum_fc get_checksum; /* Calcul de l'empreinte */
+
+ compute_size_fc compute_size; /* Calcul de la taille totale */
+
+ get_raw_access_fc get_raw_access; /* Accès brut à une position */
+
+ read_raw_fc read_raw; /* Lecture brute */
+ read_u4_fc read_u4; /* Lecture de 4 bits */
+ read_u8_fc read_u8; /* Lecture de 8 bits */
+ read_u16_fc read_u16; /* Lecture de 16 bits */
+ read_u32_fc read_u32; /* Lecture de 32 bits */
+ read_u64_fc read_u64; /* Lecture de 64 bits */
+
+};
+
+
+/* Redéfinition */
+typedef GBinContentIface GBinContentInterface;
+
+
+
+#endif /* _ANALYSIS_CONTENT_INT_H */