From fe91dd8fbcaab5374fc32ee65ba4ba7b8bb8fbe2 Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Wed, 17 May 2017 02:10:13 +0200 Subject: X86/jit: add push/pop 16bit --- miasm2/arch/x86/jit.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'miasm2/arch/x86/jit.py') diff --git a/miasm2/arch/x86/jit.py b/miasm2/arch/x86/jit.py index 6d9be8ac..9ffd8a82 100644 --- a/miasm2/arch/x86/jit.py +++ b/miasm2/arch/x86/jit.py @@ -80,6 +80,15 @@ class jitter_x86_32(jitter): def ir_archbloc_fix_regs_for_mode(self, irblock, attrib=64): self.orig_irbloc_fix_regs_for_mode(irblock, 64) + def push_uint16_t(self, value): + self.cpu.ESP -= self.ir_arch.sp.size / 8 + self.vm.set_mem(self.cpu.ESP, pck16(value)) + + def pop_uint16_t(self): + value = upck16(self.vm.get_mem(self.cpu.ESP, self.ir_arch.sp.size / 8)) + self.cpu.ESP += self.ir_arch.sp.size / 8 + return value + def push_uint32_t(self, value): self.cpu.ESP -= self.ir_arch.sp.size / 8 self.vm.set_mem(self.cpu.ESP, pck32(value)) -- cgit 1.4.1