Skip to content

Commit

Permalink
extend @op_str of cs_insn_flat following the core change
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Jan 13, 2014
1 parent 22800aa commit 3d56b82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MCInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ typedef struct cs_insn_flat {

// Ascii text of instruction operands
// This information is available even when CS_OPT_DETAIL = CS_OPT_OFF
char op_str[96];
char op_str[136];

// NOTE: All information below is not available when CS_OPT_DETAIL = CS_OPT_OFF

Expand Down
3 changes: 2 additions & 1 deletion arch/X86/X86IntelInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,13 @@ void X86_Intel_printInst(MCInst *MI, SStream *O, void *Info)
char *acc_regs[] = { "al", "ax", "eax", "rax", NULL };
int acc_regs_id[] = { X86_REG_AL, X86_REG_AX, X86_REG_EAX, X86_REG_RAX };
if (tmp[0] != 0 && ((post = str_in_list(acc_regs, tmp)) != -1)) {
// set operand size following register size
// first op is register, so set operand size following register size
MI->flat_insn.x86.op_size = 1 << post;
// tmp is a register
if ((MI->flat_insn.x86.operands[0].type != X86_OP_INVALID) &&
((MI->flat_insn.x86.operands[0].type != X86_OP_REG) ||
(MI->flat_insn.x86.operands[0].reg != acc_regs_id[post]))) {
// first op is register, so insert its detail to position 0
int i;
for (i = MI->flat_insn.x86.op_count; i > 0; i--) {
memcpy(&(MI->flat_insn.x86.operands[i]), &(MI->flat_insn.x86.operands[i - 1]),
Expand Down

0 comments on commit 3d56b82

Please sign in to comment.