libmwemu 0.24.5

x86 32/64bits and system internals emulator, for securely emulating malware and other stuff.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::emu::Emu;
use yaxpeax_arm::armv8::a64::Instruction;

use super::super::helpers::*;

pub fn execute(emu: &mut Emu, ins: &Instruction) -> bool {
    let is64 = operand_is_64(&ins.operands[0]);
    let rn = read_operand_value(emu, &ins.operands[1]);
    let rm = read_operand_value(emu, &ins.operands[2]);
    let ra = read_operand_value(emu, &ins.operands[3]);
    let result = ra.wrapping_add(rn.wrapping_mul(rm));
    let result = if is64 { result } else { result & 0xffffffff };
    write_reg(emu, &ins.operands[0], result);
    true
}