Skip to content
Snippets Groups Projects
Commit 59a9cd05 authored by an7s's avatar an7s
Browse files

Fix for getting memory displacement offset in the CMPPD/CMPSS family of instructions

Former-commit-id: 03892447ada7f5c876fd2f717470995ce4cb2ca2
parent eb88f0a5
No related branches found
No related tags found
No related merge requests found
......@@ -595,6 +595,11 @@ virtual_offset_t DecodedInstructionCapstone_t::getMemoryDisplacementOffset(const
const auto imm=getImmediate();
const auto disp=t.getMemoryDisplacement();
if(string((char*)the_insn->detail->x86.opcode)=="\x0f\xc2") // CMPPD, CMPSS
{
return the_insn->size - disp_size - 1; // last byte encodes an immediate value to distinguish pseudo-ops
}
if(imm_count==0)
return the_insn->size - disp_size;
......
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