diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2024-11-23 15:59:19 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2024-11-23 15:59:19 (GMT) |
commit | 411f03130cf45194689bc344f19a3b77c33a31ae (patch) | |
tree | f047b62015eb37e30629398f9adcb977a5a6c6f6 /src/format/executable.h | |
parent | 80d779749adf228078b61f268bf952ba91a277f0 (diff) |
Restore more features for formats.
Diffstat (limited to 'src/format/executable.h')
-rw-r--r-- | src/format/executable.h | 74 |
1 files changed, 20 insertions, 54 deletions
diff --git a/src/format/executable.h b/src/format/executable.h index 6695b92..da71d66 100644 --- a/src/format/executable.h +++ b/src/format/executable.h @@ -25,7 +25,11 @@ #define _FORMAT_EXECUTABLE_H +#include <stdbool.h> + + #include "../glibext/helpers.h" +#include "../glibext/portion.h" @@ -37,46 +41,14 @@ DECLARE_GTYPE(GExecutableFormat, g_executable_format, G, EXECUTABLE_FORMAT); /* Indique le type d'architecture visée par le format. */ char *g_executable_format_get_target_machine(const GExecutableFormat *); - - - - -#if 0 - - -/* -#include "debuggable.h" -#include "../glibext/gbinportion.h" -*/ - - - -/* Rajoute des informations de débogage à un exécutable. */ -void g_executable_format_add_debug_info(GExecutableFormat *, GDbgFormat *); - -/* Compte le nombre de formats de débogage liés à l'exécutable. */ -size_t g_executable_format_count_debug_info(const GExecutableFormat *); - -/* Fournit un format de débogage attaché à l'exécutable. */ -GDbgFormat *g_executable_format_get_debug_info(const GExecutableFormat *, size_t); - -/* Indique le type d'architecture visée par le format. */ -//const char *g_executable_format_get_target_machine(const GExecutableFormat *); - /* Fournit l'adresse principale associée à un format. */ bool g_executable_format_get_main_address(GExecutableFormat *, vmpa2t *); -/* Enregistre une portion artificielle pour le format. */ -void g_executable_format_register_user_portion(GExecutableFormat *, GBinPortion *); - /* Procède à l'enregistrement d'une portion dans un format. */ -void g_executable_format_include_portion(GExecutableFormat *, GBinPortion *, const vmpa2t *); +bool g_executable_format_include_portion(GExecutableFormat *, GBinaryPortion *, const vmpa2t *); /* Fournit la première couche des portions composent le binaire. */ -GBinPortion *g_executable_format_get_portions(GExecutableFormat *); - -/* Fournit les espaces mémoires des portions exécutables. */ -mrange_t *g_executable_format_get_x_ranges(GExecutableFormat *, size_t *); +GBinaryPortion *g_executable_format_get_portions(GExecutableFormat *); /* Fournit l'emplacement correspondant à une position physique. */ bool g_executable_format_translate_offset_into_vmpa(GExecutableFormat *, phys_t, vmpa2t *); @@ -85,30 +57,24 @@ bool g_executable_format_translate_offset_into_vmpa(GExecutableFormat *, phys_t, bool g_executable_format_translate_address_into_vmpa(GExecutableFormat *, virt_t, vmpa2t *); -#define g_executable_format_translate_offset_into_address(fmt, off, addr) \ - ({ \ - bool __result; \ - vmpa2t __pos; \ - __result = g_executable_format_translate_offset_into_vmpa(fmt, off, &__pos); \ - *addr = get_virt_addr(&__pos); \ - __result; \ +#define g_executable_format_translate_offset_into_address(fmt, off, addr) \ + ({ \ + bool __result; \ + vmpa2t __pos; \ + __result = g_executable_format_translate_offset_into_vmpa(fmt, off, &__pos); \ + *addr = get_virt_addr(&__pos); \ + __result; \ }) -#define g_executable_format_translate_address_into_offset(fmt, addr, off) \ - ({ \ - bool __result; \ - vmpa2t __pos; \ - __result = g_executable_format_translate_address_into_vmpa(fmt, addr, &__pos); \ - *off = get_phy_addr(&__pos); \ - __result; \ +#define g_executable_format_translate_address_into_offset(fmt, addr, off) \ + ({ \ + bool __result; \ + vmpa2t __pos; \ + __result = g_executable_format_translate_address_into_vmpa(fmt, addr, &__pos); \ + *off = get_phy_addr(&__pos); \ + __result; \ }) -/* Fournit l'emplacement d'une section donnée. */ -bool g_executable_format_get_section_range_by_name(const GExecutableFormat *, const char *, mrange_t *); - -#endif - - #endif /* _FORMAT_EXECUTABLE_H */ |