Skip to content

Commit

Permalink
x86: update read/write registers for transfer instructions (#2578)
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest authored Dec 15, 2024
1 parent 812e654 commit be6be78
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 156 deletions.
19 changes: 0 additions & 19 deletions arch/X86/X86Mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,25 +1153,6 @@ void X86_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
break;
}
break;

case X86_INS_RET:
switch(h->mode) {
case CS_MODE_16:
insn->detail->regs_write[0] = X86_REG_SP;
insn->detail->regs_read[0] = X86_REG_SP;
break;
case CS_MODE_32:
insn->detail->regs_write[0] = X86_REG_ESP;
insn->detail->regs_read[0] = X86_REG_ESP;
break;
default: // 64-bit
insn->detail->regs_write[0] = X86_REG_RSP;
insn->detail->regs_read[0] = X86_REG_RSP;
break;
}
insn->detail->regs_write_count = 1;
insn->detail->regs_read_count = 1;
break;
}

memcpy(insn->detail->groups, insns[i].groups, sizeof(insns[i].groups));
Expand Down
Loading

0 comments on commit be6be78

Please sign in to comment.