diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-05-24 07:43:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-05-24 07:43:32 (GMT) |
commit | 08c45a8c7970403c3d658b1b0af9ac09f66b4a7e (patch) | |
tree | 25a8108e36b7328c266ba6e71647243dfd6b7cac /src/format/executable-int.c | |
parent | 7135e7944c91d2e8b787c8782375423b9a90ed5b (diff) |
Translated offsets and addresses with more accuracy.
Diffstat (limited to 'src/format/executable-int.c')
-rw-r--r-- | src/format/executable-int.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/format/executable-int.c b/src/format/executable-int.c index e13a7c9..d20a776 100644 --- a/src/format/executable-int.c +++ b/src/format/executable-int.c @@ -79,3 +79,77 @@ bool g_exe_format_without_virt_translate_address_into_vmpa(const GExeFormat *for return true; } + + +/****************************************************************************** +* * +* Paramètres : format = description de l'exécutable à consulter. * +* off = position physique à retrouver. * +* pos = position correspondante. [OUT] * +* * +* Description : Fournit l'emplacement correspondant à une position physique. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool g_exe_format_translate_offset_into_vmpa_using_portions(GExeFormat *format, phys_t off, vmpa2t *pos) +{ + bool result; /* Bilan à retourner */ + GBinPortion *portions; /* Liste de découpages */ + + portions = g_exe_format_get_portions(format); + + if (portions == NULL) + result = false; + + else + { + result = g_binary_portion_translate_offset_into_vmpa(portions, off, pos); + + g_object_unref(G_OBJECT(portions)); + + } + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : format = description de l'exécutable à consulter. * +* addr = adresse virtuelle à retrouver. * +* pos = position correspondante. [OUT] * +* * +* Description : Fournit l'emplacement correspondant à une adresse virtuelle. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool g_exe_format_translate_address_into_vmpa_using_portions(GExeFormat *format, virt_t addr, vmpa2t *pos) +{ + bool result; /* Bilan à retourner */ + GBinPortion *portions; /* Liste de découpages */ + + portions = g_exe_format_get_portions(format); + + if (portions == NULL) + result = false; + + else + { + result = g_binary_portion_translate_address_into_vmpa(portions, addr, pos); + + g_object_unref(G_OBJECT(portions)); + + } + + return result; + +} |