diff options
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; + +} |