instr->src_operand.type = IMM_OPERAND;
instr->src_operand.size = operand_width;
+
if (operand_width == 1) {
instr->src_operand.operand = *(uint8_t *)instr_ptr;
} else if (operand_width == 2) {
return -1;
}
+ instr->src_operand.read = 1;
+ instr->dst_operand.write = 1;
+
instr_ptr += operand_width;
instr->num_operands = 2;
instr->src_operand.type = REG_OPERAND;
instr->src_operand.size = operand_width;
+ instr->src_operand.read = 1;
+ instr->dst_operand.write = 1;
+
+
decode_gpr(core, reg_code, &(instr->src_operand));
instr->num_operands = 2;
instr->dst_operand.type = REG_OPERAND;
decode_gpr(core, reg_code, &(instr->dst_operand));
+ instr->src_operand.read = 1;
+ instr->dst_operand.write = 1;
+
instr->num_operands = 2;
break;
case XOR_IMM2SX_8: {
uint8_t reg_code = 0;
- ret = decode_rm_operand(core, instr_ptr, form, instr, &(instr->src_operand), ®_code);
+ ret = decode_rm_operand(core, instr_ptr, form, instr, &(instr->dst_operand), ®_code);
+
if (ret == -1) {
PrintError("Error decoding operand\n");
instr->src_operand.size = operand_width;
instr->src_operand.operand = *(sint8_t *)instr_ptr; // sign extend.
+ instr->src_operand.read = 1;
+ instr->dst_operand.write = 1;
+
instr_ptr += 1;
instr->num_operands = 2;
instr->src_operand.size = operand_width;
instr->src_operand.operand = get_addr_linear(core, MASK(core->vm_regs.rsi, addr_width), &(core->segments.ds));
+
instr->dst_operand.type = MEM_OPERAND;
instr->dst_operand.size = operand_width;
instr->dst_operand.operand = get_addr_linear(core, MASK(core->vm_regs.rdi, addr_width), &(core->segments.es));
+
+ instr->src_operand.read = 1;
+ instr->dst_operand.write = 1;
+
instr->num_operands = 2;
break;
instr->dst_operand.size = operand_width;
decode_cr(core, reg_code, &(instr->dst_operand));
+ instr->src_operand.read = 1;
+ instr->dst_operand.write = 1;
+
instr->num_operands = 2;
break;
}
ret = decode_rm_operand(core, instr_ptr, form, instr, &(instr->dst_operand),
®_code);
+
if (ret == -1) {
PrintError("Error decoding operand for (%s)\n", op_form_to_str(form));
return -1;
instr->src_operand.size = operand_width;
decode_cr(core, reg_code, &(instr->src_operand));
+ instr->src_operand.read = 1;
+ instr->dst_operand.write = 1;
+
instr->num_operands = 2;
break;
}
instr->dst_operand.size = operand_width;
instr->dst_operand.operand = get_addr_linear(core, MASK(core->vm_regs.rdi, addr_width), &(core->segments.es));
+ instr->src_operand.read = 1;
+ instr->dst_operand.write = 1;
+
instr->num_operands = 2;
break;
case INVLPG: {
uint8_t reg_code = 0;
- // We use the dst operand here to maintain bug-for-bug compatibility with XED
-
ret = decode_rm_operand(core, instr_ptr, form, instr, &(instr->dst_operand), ®_code);
if (ret == -1) {