summaryrefslogtreecommitdiff
path: root/src/format/java/java.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/java/java.c')
-rwxr-xr-xsrc/format/java/java.c124
1 files changed, 56 insertions, 68 deletions
diff --git a/src/format/java/java.c b/src/format/java/java.c
index 39403c4..4fcecd9 100755
--- a/src/format/java/java.c
+++ b/src/format/java/java.c
@@ -45,14 +45,14 @@ static void g_java_format_class_init(GJavaFormatClass *);
/* Initialise une instance de format d'exécutable Java. */
static void g_java_format_init(GJavaFormat *);
-/* Indique le type d'architecture visée par le format. */
-static const char *g_java_format_get_target_machine(const GJavaFormat *);
+/* Supprime toutes les références externes. */
+static void g_java_format_dispose(GJavaFormat *);
-/* Fournit la position correspondant à une adresse virtuelle. */
-static bool g_java_format_translate_address_into_offset(const GJavaFormat *, vmpa_t, off_t *);
+/* Procède à la libération totale de la mémoire. */
+static void g_java_format_finalize(GJavaFormat *);
-/* Fournit l'adresse virtuelle correspondant à une position. */
-static bool g_java_format_translate_offset_into_address(const GJavaFormat *, off_t, vmpa_t *);
+/* Indique le type d'architecture visée par le format. */
+static const char *g_java_format_get_target_machine(const GJavaFormat *);
@@ -103,6 +103,21 @@ G_DEFINE_TYPE(GJavaFormat, g_java_format, G_TYPE_EXE_FORMAT);
static void g_java_format_class_init(GJavaFormatClass *klass)
{
+ GObjectClass *object; /* Autre version de la classe */
+ GExeFormatClass *exe; /* Version en exécutable */
+
+ object = G_OBJECT_CLASS(klass);
+
+ object->dispose = (GObjectFinalizeFunc/* ! */)g_java_format_dispose;
+ object->finalize = (GObjectFinalizeFunc)g_java_format_finalize;
+
+ exe = G_EXE_FORMAT_CLASS(klass);
+
+ exe->get_machine = (get_target_machine_fc)g_java_format_get_target_machine;
+ //exe->refine_portions = (refine_portions_fc)g_java_format_refine_portions;
+
+ exe->translate_phys = (translate_phys_fc)g_exe_format_without_virt_translate_offset_into_vmpa;
+ exe->translate_virt = (translate_virt_fc)g_exe_format_without_virt_translate_address_into_vmpa;
}
@@ -121,14 +136,44 @@ static void g_java_format_class_init(GJavaFormatClass *klass)
static void g_java_format_init(GJavaFormat *format)
{
- GExeFormat *exe_format; /* Format parent à constituer */
- exe_format = G_EXE_FORMAT(format);
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : format = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_java_format_dispose(GJavaFormat *format)
+{
+ G_OBJECT_CLASS(g_java_format_parent_class)->dispose(G_OBJECT(format));
+
+}
+
- exe_format->get_machine = (get_target_machine_fc)g_java_format_get_target_machine;
+/******************************************************************************
+* *
+* Paramètres : format = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
- exe_format->translate_addr = (translate_addr_fc)g_java_format_translate_address_into_offset;
- exe_format->translate_off = (translate_off_fc)g_java_format_translate_offset_into_address;
+static void g_java_format_finalize(GJavaFormat *format)
+{
+ G_OBJECT_CLASS(g_java_format_parent_class)->finalize(G_OBJECT(format));
}
@@ -189,63 +234,6 @@ static const char *g_java_format_get_target_machine(const GJavaFormat *format)
}
-/******************************************************************************
-* *
-* Paramètres : format = description de l'exécutable à consulter. *
-* addr = adresse virtuelle à retrouver. *
-* pos = position correspondante. [OUT] *
-* *
-* Description : Fournit la position correspondant à une adresse virtuelle. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_java_format_translate_address_into_offset(const GJavaFormat *format, vmpa_t addr, off_t *pos)
-{
- bool result; /* Bilan à retourner */
-
- result = false;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : format = description de l'exécutable à consulter. *
-* pos = position dans le flux binaire à retrouver. *
-* addr = adresse virtuelle correspondante. [OUT] *
-* *
-* Description : Fournit l'adresse virtuelle correspondant à une position. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_java_format_translate_offset_into_address(const GJavaFormat *format, off_t pos, vmpa_t *addr)
-{
- bool result; /* Bilan à retourner */
-
- result = false;
-
- return result;
-
-}
-
-
-
-
-
-
-
-
-