-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Bytecode \xd0\xE8\xAF\x0f
should be disassembled into 'LDA R0, [R0]' in thumb mode, but capstone cannot decompile, And the result obtained through cs_errno()
is CS_ OK
The following is the test code and the output of the code:
int main()
{
cs_mode mode[] = { CS_MODE_ARM,CS_MODE_THUMB ,CS_MODE_V8 };
const char* strmode[] = { "CS_MODE_ARM","CS_MODE_THUMB ","CS_MODE_V8"};
csh ud;
for (int i = 0; i < _countof(mode); ++i) {
cs_open(CS_ARCH_ARM, mode[i], &ud);
cs_insn* insn;
cs_disasm(ud, (uint8_t*)"\xD0\xE8\xAF\x0F", 4, 0, 1, &insn);
if (insn == nullptr) {
printf("%s fail : %s\n", strmode[i], cs_strerror(cs_errno(ud)));
}
else {
printf("%s success : %s %s\n", strmode[i], insn->mnemonic, insn->op_str);
cs_free(insn, 1);
}
cs_close(&ud);
}
return 0;
}
----------------------------------------- the output --------------------------------------------
CS_MODE_ARM success : svceq #0xafe8d0
CS_MODE_THUMB fail : OK (CS_ERR_OK)
CS_MODE_V8 success : svceq #0xafe8d0
Metadata
Metadata
Assignees
Labels
No labels