diff options
Diffstat (limited to '')
| -rw-r--r-- | miasm2/arch/aarch64/jit.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/miasm2/arch/aarch64/jit.py b/miasm2/arch/aarch64/jit.py index ca8d7b39..cd41cca8 100644 --- a/miasm2/arch/aarch64/jit.py +++ b/miasm2/arch/aarch64/jit.py @@ -2,7 +2,7 @@ import logging from miasm2.jitter.jitload import jitter, named_arguments from miasm2.core import asmbloc -from miasm2.core.utils import * +from miasm2.core.utils import pck64, upck64 from miasm2.arch.aarch64.sem import ir_aarch64b, ir_aarch64l log = logging.getLogger('jit_aarch64') @@ -19,18 +19,17 @@ class jitter_aarch64l(jitter): jitter.__init__(self, ir_aarch64l(sp), *args, **kwargs) self.vm.set_little_endian() - def push_uint64_t(self, v): + def push_uint64_t(self, value): self.cpu.SP -= 8 - self.vm.set_mem(self.cpu.SP, pck64(v)) + self.vm.set_mem(self.cpu.SP, pck64(value)) def pop_uint64_t(self): - x = upck32(self.vm.get_mem(self.cpu.SP, 8)) + value = upck64(self.vm.get_mem(self.cpu.SP, 8)) self.cpu.SP += 8 - return x + return value - def get_stack_arg(self, n): - x = upck64(self.vm.get_mem(self.cpu.SP + 8 * n, 8)) - return x + def get_stack_arg(self, index): + return upck64(self.vm.get_mem(self.cpu.SP + 8 * index, 8)) # calling conventions @@ -50,11 +49,11 @@ class jitter_aarch64l(jitter): self.cpu.X0 = ret_value return True - def get_arg_n_stdcall(self, n): - if n < self.max_reg_arg: - arg = self.cpu.get_gpreg()['X%d' % n] + def get_arg_n_stdcall(self, index): + if index < self.max_reg_arg: + arg = self.cpu.get_gpreg()['X%d' % index] else: - arg = self.get_stack_arg(n - self.max_reg_arg) + arg = self.get_stack_arg(index - self.max_reg_arg) return arg def init_run(self, *args, **kwargs): |