diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/processor.c | 114 | ||||
-rw-r--r-- | src/arch/processor.h | 30 |
2 files changed, 1 insertions, 143 deletions
diff --git a/src/arch/processor.c b/src/arch/processor.c index 2e678f6..0b33552 100644 --- a/src/arch/processor.c +++ b/src/arch/processor.c @@ -42,11 +42,6 @@ #include "artificial.h" -#include "arm/processor.h" -#include "dalvik/processor.h" -#include "jvm/processor.h" -#include "mips/processor.h" -#include "x86/processor.h" @@ -62,12 +57,6 @@ static void g_arch_processor_init(GArchProcessor *); -/* ------------------------ ARCHITECTURES DANS LEUR ENSEMBLE ------------------------ */ - - -static GArchProcessor *_processors_list[APT_COUNT]; - - @@ -305,106 +294,3 @@ GArchInstruction *g_arch_processor_disassemble(const GArchProcessor *proc, GProc return result; } - - - - - - - -/* ---------------------------------------------------------------------------------- */ -/* ARCHITECTURES DANS LEUR ENSEMBLE */ -/* ---------------------------------------------------------------------------------- */ - - -/****************************************************************************** -* * -* Paramètres : - * -* * -* Description : Procède au chargement des différentes architectures. * -* * -* Retour : Toujours true. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool init_all_processors(void) -{ - _processors_list[APT_ARM] = g_armv7_processor_new(); - _processors_list[APT_DALVIK] = g_dalvik_processor_new(); - //_processors_list[APT_JVM] = g_jvm_processor_new(); - //_processors_list[APT_MIPS] = g_mips_processor_new(); - //_processors_list[APT_386] = g_x86_processor_new(); - - return true; - -} - - -/****************************************************************************** -* * -* Paramètres : type = sorte de processeur recherché. * -* * -* Description : Fournit le processeur d'architecture correspondant à un type.* -* * -* Retour : Processeur d'architecture trouvé. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GArchProcessor *get_arch_processor_for_type(ArchProcessorType type) -{ - return _processors_list[type]; - -} - - -/****************************************************************************** -* * -* Paramètres : format = exécutable d'origine. * -* * -* Description : Fournit le processeur d'architecture lié à un format. * -* * -* Retour : Processeur d'architecture trouvé. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GArchProcessor *get_arch_processor_from_format(const GExeFormat *format) -{ - GArchProcessor *result; /* Conversion à retourner */ - - switch (g_exe_format_get_target_machine(format)) - { - case FTM_ARM: - result = get_arch_processor_for_type(APT_ARM); - break; - - case FTM_DALVIK: - result = get_arch_processor_for_type(APT_DALVIK); - break; - - case FTM_JVM: - result = get_arch_processor_for_type(APT_JVM); - break; - - case FTM_MIPS: - result = get_arch_processor_for_type(APT_MIPS); - break; - - case FTM_386: - result = get_arch_processor_for_type(APT_386); - break; - - default: - result = NULL; - break; - - } - - return result; - -} diff --git a/src/arch/processor.h b/src/arch/processor.h index ac5d811..725307f 100644 --- a/src/arch/processor.h +++ b/src/arch/processor.h @@ -32,7 +32,7 @@ #include "instruction.h" #include "../common/endianness.h" #include "../decomp/context.h" -#include "../format/format.h" +#include "../format/format.h" ////////////////// utile ? @@ -78,32 +78,4 @@ GArchInstruction *g_arch_processor_disassemble(const GArchProcessor *, GProcCont -/* ------------------------ ARCHITECTURES DANS LEUR ENSEMBLE ------------------------ */ - - -/* Type de processeurs disponibles */ -typedef enum _ArchProcessorType -{ - APT_ARM, /* ARM vX */ - APT_DALVIK, /* Dalvik Virtual Machine */ - APT_JVM, /* Java Virtual Machine */ - APT_MIPS, /* Mips 32 ou 64 bits */ - APT_386, /* Intel 80386 */ - - APT_COUNT - -} ArchProcessorType; - - -/* Procède au chargement des différentes architectures. */ -bool init_all_processors(void); - -/* Fournit le processeur d'architecture correspondant à un type. */ -GArchProcessor *get_arch_processor_for_type(ArchProcessorType); - -/* Fournit le processeur d'architecture lié à un format. */ -GArchProcessor *get_arch_processor_from_format(const GExeFormat *); - - - #endif /* _ARCH_PROCESSOR_H */ |