Skip to content
Snippets Groups Projects
Commit c88cf40c authored by Leon Weiss's avatar Leon Weiss
Browse files

Treat RIZ/EIZ as an invalid register in hasIndexRegister

parent fe68e471
No related branches found
No related tags found
1 merge request!47Improve jump table detection and debugging output
Pipeline #24953 passed
......@@ -464,9 +464,14 @@ bool DecodedOperandCapstoneX86_t::hasBaseRegister() const
bool DecodedOperandCapstoneX86_t::hasIndexRegister() const
{
const auto the_insn=static_cast<cs_insn*>(my_insn.get());
const auto &op = (the_insn->detail->x86.operands[op_num]);
return isMemory() && op.mem.index!=X86_REG_INVALID;
const auto the_insn=static_cast<cs_insn*>(my_insn.get());
const auto &op = (the_insn->detail->x86.operands[op_num]);
const auto index_reg_is_valid =
op.mem.index != X86_REG_INVALID &&
op.mem.index != X86_REG_EIZ &&
op.mem.index != X86_REG_RIZ;
return isMemory() && index_reg_is_valid;
}
uint32_t DecodedOperandCapstoneX86_t::getBaseRegister() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment