summaryrefslogtreecommitdiff
path: root/src/format/executable.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-05-24 07:43:32 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-05-24 07:43:32 (GMT)
commit08c45a8c7970403c3d658b1b0af9ac09f66b4a7e (patch)
tree25a8108e36b7328c266ba6e71647243dfd6b7cac /src/format/executable.c
parent7135e7944c91d2e8b787c8782375423b9a90ed5b (diff)
Translated offsets and addresses with more accuracy.
Diffstat (limited to 'src/format/executable.c')
-rw-r--r--src/format/executable.c52
1 files changed, 35 insertions, 17 deletions
diff --git a/src/format/executable.c b/src/format/executable.c
index 0107074..a2ee569 100644
--- a/src/format/executable.c
+++ b/src/format/executable.c
@@ -289,39 +289,57 @@ bool g_exe_format_get_main_address(GExeFormat *format, vmpa2t *addr)
* Paramètres : format = instance à traiter. *
* status = barre de statut à tenir informée. *
* *
-* Description : Effectue les ultimes opérations de chargement d'un binaire. *
+* Description : Crée les portions potentiellement utiles aux traductions. *
* *
-* Retour : Bilan de l'opération. *
+* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
-bool g_executable_format_complete_loading(GExeFormat *format, GtkStatusStack *status)
+void g_executable_format_setup_portions(GExeFormat *format, GtkStatusStack *status)
{
- bool result; /* Bilan à faire remonter */
GBinFormat *base; /* Version basique du format */
vmpa2t addr; /* Emplacement vide de sens */
phys_t length; /* Taille de portion globale */
base = G_BIN_FORMAT(format);
- result = g_binary_format_complete_loading(base, status);
+ /**
+ * Avant de lire l'entête du format, on ne sait pas où on se trouve !
+ */
+ init_vmpa(&addr, 0, VMPA_NO_VIRTUAL);
- if (result)
- {
- /**
- * Avant de lire l'entête du format, on ne sait pas où on se trouve !
- */
- init_vmpa(&addr, 0, VMPA_NO_VIRTUAL);
+ length = g_binary_content_compute_size(base->content);
+
+ format->portions = g_binary_portion_new(BPC_RAW, &addr, length);
- length = g_binary_content_compute_size(base->content);
+ G_EXE_FORMAT_GET_CLASS(format)->refine_portions(format);
- format->portions = g_binary_portion_new(BPC_RAW, &addr, length);
+}
- G_EXE_FORMAT_GET_CLASS(format)->refine_portions(format);
- }
+/******************************************************************************
+* *
+* Paramètres : format = instance à traiter. *
+* status = barre de statut à tenir informée. *
+* *
+* Description : Effectue les ultimes opérations de chargement d'un binaire. *
+* *
+* Retour : Bilan de l'opération. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool g_executable_format_complete_loading(GExeFormat *format, GtkStatusStack *status)
+{
+ bool result; /* Bilan à faire remonter */
+ GBinFormat *base; /* Version basique du format */
+
+ base = G_BIN_FORMAT(format);
+
+ result = g_binary_format_complete_loading(base, status);
return result;
@@ -447,7 +465,7 @@ GBinPortion *g_exe_format_get_portions(GExeFormat *format)
* *
******************************************************************************/
-bool g_exe_format_translate_offset_into_vmpa(const GExeFormat *format, phys_t off, vmpa2t *pos)
+bool g_exe_format_translate_offset_into_vmpa(GExeFormat *format, phys_t off, vmpa2t *pos)
{
bool result; /* Bilan à retourner */
@@ -472,7 +490,7 @@ bool g_exe_format_translate_offset_into_vmpa(const GExeFormat *format, phys_t of
* *
******************************************************************************/
-bool g_exe_format_translate_address_into_vmpa(const GExeFormat *format, virt_t addr, vmpa2t *pos)
+bool g_exe_format_translate_address_into_vmpa(GExeFormat *format, virt_t addr, vmpa2t *pos)
{
bool result; /* Bilan à retourner */