summaryrefslogtreecommitdiff
path: root/src/glibext/gbincontent.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext/gbincontent.h')
-rw-r--r--src/glibext/gbincontent.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/glibext/gbincontent.h b/src/glibext/gbincontent.h
new file mode 100644
index 0000000..1bfcfa5
--- /dev/null
+++ b/src/glibext/gbincontent.h
@@ -0,0 +1,73 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * gbincontent.h - prototypes pour le chargement de données binaires en mémoire
+ *
+ * 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 _GLIBEXT_GBINCONTENT_H
+#define _GLIBEXT_GBINCONTENT_H
+
+
+#include <glib-object.h>
+
+
+#include "../arch/archbase.h"
+#include "../arch/vmpa.h"
+#include "../common/endianness.h"
+
+
+
+#define G_TYPE_BIN_CONTENT (g_binary_content_get_type())
+#define G_BIN_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_BIN_CONTENT, GBinContent))
+#define G_IS_BIN_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_BIN_CONTENT))
+#define G_BIN_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_BIN_CONTENT, GBinContentClass))
+#define G_IS_BIN_CONTENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_BIN_CONTENT))
+#define G_BIN_CONTENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_BIN_CONTENT, GBinContentClass))
+
+
+/* Content de données binaires quelconques (instance) */
+typedef struct _GBinContent GBinContent;
+
+/* Content de données binaires quelconques (classe) */
+typedef struct _GBinContentClass GBinContentClass;
+
+
+
+/* Indique le type défini par la GLib pour les contenus de données. */
+GType g_binary_content_get_type(void);
+
+/* Charge en mémoire le contenu d'un fichier donné. */
+GBinContent *g_binary_content_new_from_file(const char *);
+
+
+
+/* Fournit une portion des données représentées. */
+bool g_binary_content_get_raw(const GBinContent *, const vmpa2t *, phys_t, bin_t *);
+
+
+
+
+const bin_t *g_binary_content_get(GBinContent *content, off_t *length);
+
+
+
+
+
+#endif /* _GLIBEXT_GBINCONTENT_H */