diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-05-16 21:56:55 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-05-16 21:56:55 (GMT) |
commit | 4691a434a34a19317156a761967f719e408b73bb (patch) | |
tree | 1daaf5be5d4a9f52d492380c2862580129d2ad12 /src/format/symbol.h | |
parent | 1996274a43883aa58e8c565f7698bc7c338a9ce0 (diff) |
Merged routines into symbols.
Diffstat (limited to 'src/format/symbol.h')
-rw-r--r-- | src/format/symbol.h | 56 |
1 files changed, 11 insertions, 45 deletions
diff --git a/src/format/symbol.h b/src/format/symbol.h index 0d40529..da51262 100644 --- a/src/format/symbol.h +++ b/src/format/symbol.h @@ -28,10 +28,6 @@ #include <glib-object.h> -#include "../analysis/routine.h" -#include "../analysis/db/item.h" -#include "../analysis/db/items/comment.h" -#include "../arch/instruction.h" #include "../glibext/linegen.h" @@ -55,10 +51,6 @@ typedef enum _SymbolType } SymbolType; -#define HAS_DATA_INSTR(type) (type == STP_DATA || type == STP_RO_STRING) - - - #define G_TYPE_BIN_SYMBOL g_binary_symbol_get_type() #define G_BIN_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_binary_symbol_get_type(), GBinSymbol)) #define G_IS_BIN_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_binary_symbol_get_type())) @@ -78,7 +70,7 @@ typedef struct _GBinSymbolClass GBinSymbolClass; GType g_binary_symbol_get_type(void); /* Crée un nouveau symbole d'exécutable. */ -GBinSymbol *g_binary_symbol_new(SymbolType); +GBinSymbol *g_binary_symbol_new(const mrange_t *, SymbolType); /* Compare deux symboles d'exécutable selon leurs propriétés. */ int g_binary_symbol_cmp(const GBinSymbol * const *, const GBinSymbol * const *); @@ -86,49 +78,23 @@ int g_binary_symbol_cmp(const GBinSymbol * const *, const GBinSymbol * const *); /* Compare un symbole et une localisation. */ int g_binary_symbol_cmp_with_vmpa(const GBinSymbol *, const vmpa2t *); -/* Fournit le type du symbole. */ -SymbolType g_binary_symbol_get_target_type(const GBinSymbol *); - -/* Fournit un étiquette pour viser un symbole. */ -const char *g_binary_symbol_get_label(const GBinSymbol *); - -/* Définit un autre nom pour le symbole. */ -void g_binary_symbol_set_alt_label(GBinSymbol *, const char *); +/* Définit la couverture physique / en mémoire d'un symbole. */ +void g_binary_symbol_set_range(GBinSymbol *, const mrange_t *); /* Fournit l'emplacement où se situe un symbole. */ const mrange_t *g_binary_symbol_get_range(const GBinSymbol *); -/* Attache la routine associée au symbole. */ -void _g_binary_symbol_attach_routine(GBinSymbol *, GBinRoutine *, SymbolType); - -/* Attache la routine associée au symbole. */ -void g_binary_symbol_attach_routine(GBinSymbol *, GBinRoutine *); - -/* Attache l'instruction associée au symbole. */ -void g_binary_symbol_attach_instruction(GBinSymbol *, GArchInstruction *); - -/* Fournit l'éventuelle routine associée au symbole. */ -GBinRoutine *g_binary_symbol_get_routine(const GBinSymbol *); - -/* Fournit l'éventuelle instruction associée au symbole. */ -GArchInstruction *g_binary_symbol_get_instruction(const GBinSymbol *); - - -/** - * Confort pour l'ajout de symboles basés sur des formats. - */ - +/* Définit le type du symbole. */ +void g_binary_symbol_set_target_type(GBinSymbol *, SymbolType); +/* Fournit le type du symbole. */ +SymbolType g_binary_symbol_get_target_type(const GBinSymbol *); +/* Fournit une étiquette pour viser un symbole. */ +const char *g_binary_symbol_get_label(GBinSymbol *); -#define ADD_STR_AS_SYM(_fmt, _sym, _ins) \ - ({ \ - bool __result; \ - _sym = g_binary_symbol_new(STP_RO_STRING); \ - g_binary_symbol_attach_instruction(_sym, _ins); \ - __result = g_binary_format_add_symbol(G_BIN_FORMAT(_fmt), _sym); \ - __result; \ - }) +/* Définit un autre nom pour le symbole. */ +void g_binary_symbol_set_alt_label(GBinSymbol *, const char *); |