commit
7aa11ac41d
8
MCInst.c
8
MCInst.c
|
@ -17,14 +17,6 @@
|
||||||
|
|
||||||
void MCInst_Init(MCInst *inst)
|
void MCInst_Init(MCInst *inst)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
// this loop consumes 2% of the whole disasm work
|
|
||||||
unsigned int i;
|
|
||||||
for (i = 0; i < 48; i++) {
|
|
||||||
inst->Operands[i].Kind = kInvalid;
|
|
||||||
inst->Operands[i].ImmVal = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// unnecessary to initialize in loop . its expensive and inst->size shuold be honored
|
// unnecessary to initialize in loop . its expensive and inst->size shuold be honored
|
||||||
inst->Operands[0].Kind = kInvalid;
|
inst->Operands[0].Kind = kInvalid;
|
||||||
inst->Operands[0].ImmVal = 0;
|
inst->Operands[0].ImmVal = 0;
|
||||||
|
|
28
cs.c
28
cs.c
|
@ -562,22 +562,6 @@ static void fill_insn(struct cs_struct *handle, cs_insn *insn, char *buffer, MCI
|
||||||
if (tab) {
|
if (tab) {
|
||||||
strcpy (insn->op_str, tab + 1);
|
strcpy (insn->op_str, tab + 1);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
// fill in mnemonic & operands
|
|
||||||
// find first space or tab
|
|
||||||
mnem = insn->mnemonic;
|
|
||||||
for (sp = buffer; *sp; sp++) {
|
|
||||||
if (*sp == ' '|| *sp == '\t')
|
|
||||||
break;
|
|
||||||
if (*sp == '|') // lock|rep prefix for x86
|
|
||||||
*sp = ' ';
|
|
||||||
// copy to @mnemonic
|
|
||||||
*mnem = *sp;
|
|
||||||
mnem++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*mnem = '\0';
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// we might have customized mnemonic
|
// we might have customized mnemonic
|
||||||
if (handle->mnem_list) {
|
if (handle->mnem_list) {
|
||||||
|
@ -597,18 +581,6 @@ static void fill_insn(struct cs_struct *handle, cs_insn *insn, char *buffer, MCI
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
// copy @op_str
|
|
||||||
if (*sp) {
|
|
||||||
// find the next non-space char
|
|
||||||
sp++;
|
|
||||||
for (; ((*sp == ' ') || (*sp == '\t')); sp++);
|
|
||||||
strncpy(insn->op_str, sp, sizeof(insn->op_str) - 1);
|
|
||||||
insn->op_str[sizeof(insn->op_str) - 1] = '\0';
|
|
||||||
} else
|
|
||||||
insn->op_str[0] = '\0';
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue