diff options
| author | _Frky <3105926+Frky@users.noreply.github.com> | 2020-01-28 17:00:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-28 17:00:42 +0100 |
| commit | eb98df0bcab321ebb45ed6b307baee3b9cca00bc (patch) | |
| tree | 6f99e4eab69c04d0e55412996df2ed9ae4ed2925 | |
| parent | 232accb6b23c284bf4c30ac89c6f0524010fbfa1 (diff) | |
| download | miasm-eb98df0bcab321ebb45ed6b307baee3b9cca00bc.tar.gz miasm-eb98df0bcab321ebb45ed6b307baee3b9cca00bc.zip | |
Fix bug in Microsoft x86-64 calling convention
| -rw-r--r-- | miasm/arch/x86/jit.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/miasm/arch/x86/jit.py b/miasm/arch/x86/jit.py index 8ecab5fa..3c0d1b33 100644 --- a/miasm/arch/x86/jit.py +++ b/miasm/arch/x86/jit.py @@ -229,7 +229,10 @@ class jitter_x86_64(Jitter): for i in range(min(n_args, 4)): args.append(self.cpu.get_gpreg()[args_regs[i]]) for i in range(max(0, n_args - 4)): - args.append(self.get_stack_arg(i)) + # Take into account the shadow registers on the stack + # (Microsoft 64bit stdcall ABI) + # => Skip the first 4 stack parameters + args.append(self.get_stack_arg(4 + i)) return ret_ad, args def func_prepare_stdcall(self, ret_addr, *args): |