diff options
Diffstat (limited to 'src/format')
-rw-r--r-- | src/format/elf/e_elf.c | 20 | ||||
-rw-r--r-- | src/format/exe_format.c | 20 | ||||
-rw-r--r-- | src/format/exe_format.h | 3 |
3 files changed, 40 insertions, 3 deletions
diff --git a/src/format/elf/e_elf.c b/src/format/elf/e_elf.c index dac0cd7..b5e3406 100644 --- a/src/format/elf/e_elf.c +++ b/src/format/elf/e_elf.c @@ -242,7 +242,25 @@ elf_format *load_elf(const uint8_t *content, off_t length) FormatTargetMachine get_elf_target_machine(const elf_format *format) { - return FTM_386; + FormatTargetMachine result; /* Identifiant à retourner */ + + switch (format->header.e_machine) + { + case EM_MIPS: + result = FTM_MIPS; + break; + + case EM_386: + result = FTM_386; + break; + + default: + /* FIXME */ + break; + + } + + return result; } diff --git a/src/format/exe_format.c b/src/format/exe_format.c index aeeaea3..5ddb934 100644 --- a/src/format/exe_format.c +++ b/src/format/exe_format.c @@ -360,7 +360,25 @@ const uint8_t *get_exe_content(const exe_format *format, off_t *length) FormatTargetMachine get_exe_target_machine(const exe_format *format) { - return format->get_target_machine(format); + FormatTargetMachine result; /* Type à retourner */ + + result = format->get_target_machine(format); + + switch (result) + { + case FTM_JVM: + log_simple_message(LMT_INFO, _("Detected architecture: Java Virtual Machine")); + break; + case FTM_MIPS: + log_simple_message(LMT_INFO, _("Detected architecture: Microprocessor without Interlocked Pipeline Stages")); + break; + case FTM_386: + log_simple_message(LMT_INFO, _("Detected architecture: X386")); + break; + + } + + return result; } diff --git a/src/format/exe_format.h b/src/format/exe_format.h index 2c10d65..de9f025 100644 --- a/src/format/exe_format.h +++ b/src/format/exe_format.h @@ -92,8 +92,9 @@ exe_format *load_new_exe_format(const uint8_t *, off_t); /* Architectures de destination des formats */ typedef enum _FormatTargetMachine { - FTM_386, /* Intel 80386 */ FTM_JVM, /* Java Virtual Machine */ + FTM_MIPS, /* Mips 32 ou 64 bits */ + FTM_386, /* Intel 80386 */ FTM_COUNT |