about summary refs log tree commit diff stats
path: root/miasm2/arch/mips32/jit.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2014-10-09 17:04:36 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2014-10-09 17:04:36 +0200
commit7101a6d9d5998102d0dc6a86ac01ba332fed3506 (patch)
tree2981aa9d677f614f0ded8476f6e86c20e6c28107 /miasm2/arch/mips32/jit.py
parent59ef1b1d854cac3e94cd4565a0ac750de9a4c92d (diff)
downloadmiasm-7101a6d9d5998102d0dc6a86ac01ba332fed3506.tar.gz
miasm-7101a6d9d5998102d0dc6a86ac01ba332fed3506.zip
Arch/jit: add endianess support jitters
Diffstat (limited to 'miasm2/arch/mips32/jit.py')
-rw-r--r--miasm2/arch/mips32/jit.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/miasm2/arch/mips32/jit.py b/miasm2/arch/mips32/jit.py
index 61fa8a5a..93223896 100644
--- a/miasm2/arch/mips32/jit.py
+++ b/miasm2/arch/mips32/jit.py
@@ -1,7 +1,7 @@
 from miasm2.jitter.jitload import jitter
 from miasm2.core import asmbloc
 from miasm2.core.utils import *
-from miasm2.arch.mips32.sem import ir_mips32
+from miasm2.arch.mips32.sem import ir_mips32l, ir_mips32b
 
 import logging
 
@@ -11,13 +11,13 @@ hnd.setFormatter(logging.Formatter("[%(levelname)s]: %(message)s"))
 log.addHandler(hnd)
 log.setLevel(logging.CRITICAL)
 
-class jitter_mips32(jitter):
+class jitter_mips32l(jitter):
 
     def __init__(self, *args, **kwargs):
         sp = asmbloc.asm_symbol_pool()
-        jitter.__init__(self, ir_mips32(sp), *args, **kwargs)
+        jitter.__init__(self, ir_mips32l(sp), *args, **kwargs)
+        self.vm.set_little_endian()
         self.ir_arch.jit_pc = self.ir_arch.arch.regs.PC
-        self.ir_arch.attrib = 'l'
 
     def push_uint32_t(self, v):
         self.cpu.SP -= 4
@@ -35,3 +35,11 @@ class jitter_mips32(jitter):
     def init_run(self, *args, **kwargs):
         jitter.init_run(self, *args, **kwargs)
         self.cpu.PC = self.pc
+
+
+class jitter_mips32b(jitter_mips32l):
+    def __init__(self, *args, **kwargs):
+        sp = asmbloc.asm_symbol_pool()
+        jitter.__init__(self, ir_mips32b(sp), *args, **kwargs)
+        self.vm.set_big_endian()
+        self.ir_arch.jit_pc = self.ir_arch.arch.regs.PC