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
16
17
18
use crate::emu::Emu;
use yaxpeax_arm::armv8::a64::{Instruction, Operand};

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

pub fn execute(emu: &mut Emu, ins: &Instruction) -> bool {
    let cond = match ins.operands[3] {
        Operand::ConditionCode(c) => c,
        _ => return false,
    };
    let result = if emu.regs_aarch64().nzcv.eval_condition(cond) {
        read_operand_value(emu, &ins.operands[1])
    } else {
        (read_operand_value(emu, &ins.operands[2]) as i64).wrapping_neg() as u64
    };
    write_reg(emu, &ins.operands[0], result);
    true
}