diff options
| author | Adrien Guinet <aguinet@quarkslab.com> | 2018-07-12 10:56:03 +0200 |
|---|---|---|
| committer | Adrien Guinet <aguinet@quarkslab.com> | 2018-07-12 10:57:18 +0200 |
| commit | d598d9b03dd6f06dfa7f3bbbfdfaa6a5e0e16f25 (patch) | |
| tree | f1e62fa63e9f0f903acf9ab9eb1a818b16013220 | |
| parent | 9ac830aef7a15edb499658474282b5889b955b1a (diff) | |
| download | miasm-d598d9b03dd6f06dfa7f3bbbfdfaa6a5e0e16f25.tar.gz miasm-d598d9b03dd6f06dfa7f3bbbfdfaa6a5e0e16f25.zip | |
Fix ARM C function calling
Arguments were not pushed correctly on the stack (for functions with more than four arguments)
| -rw-r--r-- | miasm2/arch/arm/jit.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/miasm2/arch/arm/jit.py b/miasm2/arch/arm/jit.py index 10a7c644..2b5dc4cf 100644 --- a/miasm2/arch/arm/jit.py +++ b/miasm2/arch/arm/jit.py @@ -90,8 +90,8 @@ class jitter_arml(Jitter): def func_prepare_stdcall(self, ret_addr, *args): for index in xrange(min(len(args), 4)): setattr(self.cpu, 'R%d' % index, args[index]) - for index in xrange(4, len(args)): - self.vm.set_mem(self.cpu.SP + 4 * (index - 4), pck32(args[index])) + for index in reversed(xrange(4, len(args))): + self.push_uint32_t(args[index]) self.cpu.LR = ret_addr def get_arg_n_stdcall(self, index): |